Fix ISY blocking bug (#16978)

This fix results in `is_on` returning False if the state is unknown (which was a bug in 0.79).
This commit is contained in:
Greg Laabs 2018-09-30 00:21:27 -07:00 committed by Paulus Schoutsen
parent 8b1bdda0fa
commit 7f47d601f1

View File

@ -31,12 +31,14 @@ class ISYLightDevice(ISYDevice, Light):
@property
def is_on(self) -> bool:
"""Get whether the ISY994 light is on."""
if self.is_unknown():
return False
return self.value != 0
@property
def brightness(self) -> float:
"""Get the brightness of the ISY994 light."""
return self.value
return None if self.is_unknown() else self.value
def turn_off(self, **kwargs) -> None:
"""Send the turn off command to the ISY994 light device."""