Skip to content

Commit

Permalink
Fix ZHA light crashing on color loop effect (home-assistant#33298)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Mar 27, 2020
1 parent 4f767dd commit 6cafc45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion homeassistant/components/zha/light.py
Original file line number Diff line number Diff line change
@@ -321,6 +321,7 @@ def __init__(self, unique_id, zha_device: ZhaDeviceType, channels, **kwargs):
self._color_channel = self.cluster_channels.get(CHANNEL_COLOR)
self._identify_channel = self.zha_device.channels.identify_ch
self._cancel_refresh_handle = None
effect_list = []

if self._level_channel:
self._supported_features |= light.SUPPORT_BRIGHTNESS
@@ -338,11 +339,14 @@ def __init__(self, unique_id, zha_device: ZhaDeviceType, channels, **kwargs):

if color_capabilities & CAPABILITIES_COLOR_LOOP:
self._supported_features |= light.SUPPORT_EFFECT
self._effect_list.append(light.EFFECT_COLORLOOP)
effect_list.append(light.EFFECT_COLORLOOP)

if self._identify_channel:
self._supported_features |= light.SUPPORT_FLASH

if effect_list:
self._effect_list = effect_list

@callback
def async_set_state(self, attr_id, attr_name, value):
"""Set the state."""

0 comments on commit 6cafc45

Please sign in to comment.