Add supported_features to cover component#6082
Conversation
|
@armills, thanks for your PR! By analyzing the history of the files in this pull request, we identified @turbokongen, @balloob and @pvizeli to be potential reviewers. |
| ] | ||
|
|
||
| SUPPORT_OPEN = 1 | ||
| SUPPORT_CLOSE = 2 |
There was a problem hiding this comment.
Why would we separate open and close? I don't think there will ever be a use case that has no open and close.
Even if a device does not have open and close specific but has set position, they could mimick open and close by setting position to fully open or fully closed. So I think that we can remove those.
There was a problem hiding this comment.
I do think that we need to keep the open/close separate from the set position, because although set position can emulate open/close, the opposite isn't true. It's very possible that there is a device that tracks position, but only has binary open/close commands.
As far as open/close being separate, I don't have any example of a device, but it certainly could be possible. I wouldn't have predicted a media player that does support next track but doesn't support previous, and then Pandora came around.
What about a compromise, where we have one flag SUPPORT_OPENCLOSE = 3, that way they could be broken out in the future if necessary, but don't clutter the current code? It's not necessary for my case, but I'd like to leave options open for the future.
There was a problem hiding this comment.
Okay, you convinced me. I'm fine with it.
| SUPPORT_SET_POSITION = 4 | ||
| SUPPORT_STOP = 8 | ||
| SUPPORT_OPEN_TILT = 16 | ||
| SUPPORT_CLOSE_TILT = 32 |
There was a problem hiding this comment.
Same here, can be merged with open tilt ?
Description:
This PR adds supported_features to the cover component. Currently the use case is for zwave garage doors, which don't support the cover_stop service. This allows entities to declare their supported features so the frontend can display the appropriate controls.
See also:
home-assistant/frontend#215
Checklist:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass