Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Command options for channels #5099

Open
sjsf opened this issue Feb 16, 2018 · 1 comment
Open

Command options for channels #5099

sjsf opened this issue Feb 16, 2018 · 1 comment

Comments

@sjsf
Copy link
Contributor

sjsf commented Feb 16, 2018

There have been several discussions previously about channels which primary purpose is to send commands towards a device (i.e. the opposite direction of trigger channels). There are references in #4272 (comment), #3740 (comment), #4942 and probably some more. Also, there are numerous bindings which support this use-case.

While normal state channels so far have been a good fit for such use-cases, the bindings currently do not have any proper means to express the purpose of such channels and what commands/values are possible or expected: Bindings can only define state options, i.e. a mapping between discrete values and their labels in order to give clues to the UIs how they should be rendered. The same clue is missing for commands currently (which is not necessarily identical).

If there would be something like "command options", then UIs could use them to render the corresponding controls, e.g. buttons instead of the plain number or a drop-down.

@maggu2810
Copy link
Contributor

Bindings can only define state options, i.e. a mapping between discrete values and their labels in order to give clues to the UIs how they should be rendered. The same clue is missing for commands currently (which is not necessarily identical).

Correct, it seems there is something missing 😉

htreu pushed a commit to htreu/smarthome that referenced this issue Feb 21, 2018
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 <henning.treu@telekom.de>
htreu pushed a commit to htreu/smarthome that referenced this issue Nov 7, 2018
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 <henning.treu@telekom.de>
htreu pushed a commit to htreu/smarthome that referenced this issue Jan 11, 2019
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 <henning.treu@telekom.de>
kaikreuzer pushed a commit that referenced this issue Jan 31, 2019
* WIP: Extend ChannelType description by command options

This is WIP and open for discussion.

This addresses #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 <henning.treu@telekom.de>
htreu added a commit to htreu/openhab-core that referenced this issue Feb 6, 2019
This addresses eclipse-archived/smarthome#5099 by adding a command description with command options along with the state description.
Command options will give a hint to UIs about the specific commands a channel provides. Command options could be rendered as a drop down and also represent the current state or rendered as push buttons to simply send a command to the ThingHandler.
The infrstructure basically copies the StateDescription infrastructure with CommandDescriptionProviders and an `DynamicCommandDescriptionProvider` interface for bindings to hook in and provide dynamic command options.

Signed-off-by: Henning Treu <henning.treu@googlemail.com>
htreu added a commit to htreu/openhab-core that referenced this issue Feb 6, 2019
This addresses eclipse-archived/smarthome#5099 by adding a command description with command options along with the state description.
Command options will give a hint to UIs about the specific commands a channel provides. Command options could be rendered as a drop down and also represent the current state or rendered as push buttons to simply send a command to the ThingHandler.
The infrstructure basically copies the StateDescription infrastructure with CommandDescriptionProviders and an `DynamicCommandDescriptionProvider` interface for bindings to hook in and provide dynamic command options.

Signed-off-by: Henning Treu <henning.treu@googlemail.com>
htreu added a commit to htreu/openhab-core that referenced this issue Feb 6, 2019
This addresses eclipse-archived/smarthome#5099 by adding a command description with command options along with the state description.
Command options will give a hint to UIs about the specific commands a channel provides. Command options could be rendered as a drop down and also represent the current state or rendered as push buttons to simply send a command to the ThingHandler.
The infrstructure basically copies the StateDescription infrastructure with CommandDescriptionProviders and an `DynamicCommandDescriptionProvider` interface for bindings to hook in and provide dynamic command options.

Signed-off-by: Henning Treu <henning.treu@googlemail.com>
htreu added a commit to htreu/openhab-core that referenced this issue Feb 8, 2019
This addresses eclipse-archived/smarthome#5099 by adding a command description with command options along with the state description.
Command options will give a hint to UIs about the specific commands a channel provides. Command options could be rendered as a drop down and also represent the current state or rendered as push buttons to simply send a command to the ThingHandler.
The infrstructure basically copies the StateDescription infrastructure with CommandDescriptionProviders and an `DynamicCommandDescriptionProvider` interface for bindings to hook in and provide dynamic command options.

Signed-off-by: Henning Treu <henning.treu@googlemail.com>
maggu2810 pushed a commit to openhab/openhab-core that referenced this issue Feb 12, 2019
This addresses eclipse-archived/smarthome#5099 by adding a command description with command options along with the state description.
Command options will give a hint to UIs about the specific commands a channel provides. Command options could be rendered as a drop down and also represent the current state or rendered as push buttons to simply send a command to the ThingHandler.
The infrstructure basically copies the StateDescription infrastructure with CommandDescriptionProviders and an `DynamicCommandDescriptionProvider` interface for bindings to hook in and provide dynamic command options.

Signed-off-by: Henning Treu <henning.treu@googlemail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants