From 0f7959090d3e06bcda4755c1f50def20fa5ac13e Mon Sep 17 00:00:00 2001 From: David Mulcahey Date: Thu, 7 Feb 2019 11:16:38 -0500 Subject: [PATCH] fix light bugs --- homeassistant/components/zha/core/listeners.py | 2 ++ homeassistant/components/zha/light.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/zha/core/listeners.py b/homeassistant/components/zha/core/listeners.py index 035c752c42bae..3605f4a988582 100644 --- a/homeassistant/components/zha/core/listeners.py +++ b/homeassistant/components/zha/core/listeners.py @@ -69,6 +69,8 @@ async def wrapper(*args, **kwds): "{}: {}".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, diff --git a/homeassistant/components/zha/light.py b/homeassistant/components/zha/light.py index 1d1b4c5f921d1..09f1812cd7602 100644 --- a/homeassistant/components/zha/light.py +++ b/homeassistant/components/zha/light.py @@ -113,7 +113,7 @@ def set_level(self, value): """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):