forked from eclipse-archived/smarthome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Extend ChannelType description by command options
This is WIP and open for discussion. This addresses eclipse-archived#5099 by adding command options as an alternative to a state description. The implementation is naive and straigt forward. Command options will be rendered as push buttons by UIs and send the corresponding command value as a command to the channel. With this proposal, the state of the channel will not be represented in the UI, so ThingHandelers may not even update the state. Signed-off-by: Henning Treu <[email protected]>
- Loading branch information
Henning Treu
committed
Feb 21, 2018
1 parent
3462cda
commit 997f2be
Showing
12 changed files
with
188 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
....eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/types/CommandOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Copyright (c) 2014,2018 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.smarthome.core.types; | ||
|
||
import java.nio.channels.Channel; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* Represents a command option for "write only" command {@link Channel}s. CommandOptions will be rendered as | ||
* push-buttons in the UI and will not represent a state. | ||
* | ||
* @author Henning Treu - initial contribution | ||
* | ||
*/ | ||
@NonNullByDefault | ||
public class CommandOption { | ||
|
||
/** | ||
* The command which will be send to the Channel | ||
*/ | ||
private final String command; | ||
|
||
/** | ||
* The name of the command which will be displayed in the UI. | ||
*/ | ||
private final String name; | ||
|
||
public CommandOption(String command, String name) { | ||
this.command = command; | ||
this.name = name; | ||
} | ||
|
||
public String getCommand() { | ||
return command; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.