From 717a21dc7bcb5c95f53996f7ba893f78681c8c80 Mon Sep 17 00:00:00 2001 From: N1c093 <59510296+N1c093@users.noreply.github.com> Date: Mon, 15 Jun 2020 18:17:54 +0200 Subject: [PATCH] Fix nanoleaf attribute when running an effect (#36794) --- homeassistant/components/nanoleaf/light.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/nanoleaf/light.py b/homeassistant/components/nanoleaf/light.py index a7bf75a15d2..ed1e4877a31 100644 --- a/homeassistant/components/nanoleaf/light.py +++ b/homeassistant/components/nanoleaf/light.py @@ -230,7 +230,6 @@ class NanoleafLight(LightEntity): try: self._available = self._light.available self._brightness = self._light.brightness - self._color_temp = self._light.color_temperature self._effects_list = self._light.effects # Nanoleaf api returns non-existent effect named "*Solid*" when light set to solid color. # This causes various issues with scening (see https://github.com/home-assistant/core/issues/36359). @@ -238,7 +237,12 @@ class NanoleafLight(LightEntity): self._effect = ( self._light.effect if self._light.effect in self._effects_list else None ) - self._hs_color = self._light.hue, self._light.saturation + if self._effect is None: + self._color_temp = self._light.color_temperature + self._hs_color = self._light.hue, self._light.saturation + else: + self._color_temp = None + self._hs_color = None self._state = self._light.on except Unavailable as err: _LOGGER.error("Could not update status for %s (%s)", self.name, err)