Fix zha light bugs (#20825)

This commit is contained in:
David F. Mulcahey 2019-02-07 18:09:47 -05:00 committed by Martin Hjelmare
parent 542f024356
commit 32f2221b22
2 changed files with 3 additions and 1 deletions

View file

@ -69,6 +69,8 @@ def decorate_command(listener, command):
"{}: {}".format("with args", args),
"{}: {}".format("with kwargs", kwds),
"{}: {}".format("and result", result))
if isinstance(result, bool):
return result
return result[1] is Status.SUCCESS
except DeliveryError:
_LOGGER.debug("%s: command failed: %s", listener.unique_id,

View file

@ -113,7 +113,7 @@ class Light(ZhaEntity, light.Light):
"""Set the brightness of this light between 0..255."""
value = max(0, min(255, value))
self._brightness = value
self.async_set_state(value)
self.async_schedule_update_ha_state()
@property
def hs_color(self):