From bdea22219631b52d82df57a0eb8e4ee5358b87c4 Mon Sep 17 00:00:00 2001 From: OleksandrBerchenko Date: Tue, 19 Feb 2019 07:01:26 +0200 Subject: [PATCH] Expose effect_list attribute for turned off lights (#20750) --- homeassistant/components/light/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 816f93b5881..93d7a67c6f0 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -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}