Add basic support for lights in bond integration (#37802)

This commit is contained in:
Eugene Prystupa authored and GitHub committed 2020-07-12 18:45:47 -05:00
1 parent b63f882c3f
commit f32f73a7d1
5 files changed
+173 -2

No files matched your search

+14
View File
@@ -42,6 +42,20 @@ class BondDevice:
> 0
)
def supports_light(self) -> bool:
"""Return True if this device supports any of the light related commands."""
actions: List[str] = self._attrs["actions"]
return (
len(
[
action
for action in actions
if action in [Actions.TURN_LIGHT_ON, Actions.TOGGLE_LIGHT]
]
)
> 0
)
class BondHub:
"""Hub device representing Bond Bridge."""