mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Fix nanoleaf attribute when running an effect (#36794)
This commit is contained in:
parent
1b6f0b78aa
commit
717a21dc7b
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user