From 32f2221b22785212ca0157dcbcc7afa7a248e65f Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Thu, 7 Feb 2019 18:09:47 -0500 Subject: [PATCH] Fix zha light bugs (#20825) --- 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 035c752c42b..3605f4a9885 100644 --- a/homeassistant/components/zha/core/listeners.py +++ b/homeassistant/components/zha/core/listeners.py @@ -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, diff --git a/homeassistant/components/zha/light.py b/homeassistant/components/zha/light.py index 1d1b4c5f921..09f1812cd76 100644 --- a/homeassistant/components/zha/light.py +++ b/homeassistant/components/zha/light.py @@ -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):