Add basic support for lights in bond integration (#37802)
This commit is contained in:
1 parent
b63f882c3f
commit
f32f73a7d1
5 files changed
+173
-2
No files matched your search
@@ -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."""
|
||||
|
||||
Reference in new issue
Block a user