Expose effect_list attribute for turned off lights (#20750)

This commit is contained in:
OleksandrBerchenko authored and Rohan Kapoor committed 2019-02-18 21:01:26 -08:00
1 parent d1ebe2cbac
commit bdea222196
1 file changed
+3 -1
+3 -1
View File
@@ -440,6 +440,9 @@ class Light(ToggleEntity):
data[ATTR_MIN_MIREDS] = self.min_mireds
data[ATTR_MAX_MIREDS] = self.max_mireds
if supported_features & SUPPORT_EFFECT:
data[ATTR_EFFECT_LIST] = self.effect_list
if self.is_on:
if supported_features & SUPPORT_BRIGHTNESS:
data[ATTR_BRIGHTNESS] = self.brightness
@@ -461,7 +464,6 @@ class Light(ToggleEntity):
data[ATTR_WHITE_VALUE] = self.white_value
if supported_features & SUPPORT_EFFECT:
data[ATTR_EFFECT_LIST] = self.effect_list
data[ATTR_EFFECT] = self.effect
return {key: val for key, val in data.items() if val is not None}