mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 13:15:18 +02:00
Fix nanoleaf attribute when running an effect (#36794)
This commit is contained in:
@@ -230,7 +230,6 @@ class NanoleafLight(LightEntity):
|
|||||||
try:
|
try:
|
||||||
self._available = self._light.available
|
self._available = self._light.available
|
||||||
self._brightness = self._light.brightness
|
self._brightness = self._light.brightness
|
||||||
self._color_temp = self._light.color_temperature
|
|
||||||
self._effects_list = self._light.effects
|
self._effects_list = self._light.effects
|
||||||
# Nanoleaf api returns non-existent effect named "*Solid*" when light set to solid color.
|
# 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).
|
# 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._effect = (
|
||||||
self._light.effect if self._light.effect in self._effects_list else None
|
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
|
self._state = self._light.on
|
||||||
except Unavailable as err:
|
except Unavailable as err:
|
||||||
_LOGGER.error("Could not update status for %s (%s)", self.name, err)
|
_LOGGER.error("Could not update status for %s (%s)", self.name, err)
|
||||||
|
Reference in New Issue
Block a user