mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix ZHA light crashing on color loop effect (#33298)
This commit is contained in:
parent
4f767dd3ef
commit
6cafc45d2b
@ -321,6 +321,7 @@ class Light(ZhaEntity, BaseLight):
|
|||||||
self._color_channel = self.cluster_channels.get(CHANNEL_COLOR)
|
self._color_channel = self.cluster_channels.get(CHANNEL_COLOR)
|
||||||
self._identify_channel = self.zha_device.channels.identify_ch
|
self._identify_channel = self.zha_device.channels.identify_ch
|
||||||
self._cancel_refresh_handle = None
|
self._cancel_refresh_handle = None
|
||||||
|
effect_list = []
|
||||||
|
|
||||||
if self._level_channel:
|
if self._level_channel:
|
||||||
self._supported_features |= light.SUPPORT_BRIGHTNESS
|
self._supported_features |= light.SUPPORT_BRIGHTNESS
|
||||||
@ -338,11 +339,14 @@ class Light(ZhaEntity, BaseLight):
|
|||||||
|
|
||||||
if color_capabilities & CAPABILITIES_COLOR_LOOP:
|
if color_capabilities & CAPABILITIES_COLOR_LOOP:
|
||||||
self._supported_features |= light.SUPPORT_EFFECT
|
self._supported_features |= light.SUPPORT_EFFECT
|
||||||
self._effect_list.append(light.EFFECT_COLORLOOP)
|
effect_list.append(light.EFFECT_COLORLOOP)
|
||||||
|
|
||||||
if self._identify_channel:
|
if self._identify_channel:
|
||||||
self._supported_features |= light.SUPPORT_FLASH
|
self._supported_features |= light.SUPPORT_FLASH
|
||||||
|
|
||||||
|
if effect_list:
|
||||||
|
self._effect_list = effect_list
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_set_state(self, attr_id, attr_name, value):
|
def async_set_state(self, attr_id, attr_name, value):
|
||||||
"""Set the state."""
|
"""Set the state."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user