From b3c9d854f5547f83acc295a11a91821766e46065 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 23 Apr 2021 01:47:33 +0200 Subject: [PATCH] Correct min and max mired for light with color_mode support (#49572) --- homeassistant/components/light/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index 1b55aa51c45..835c4fd2fa9 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -635,17 +635,16 @@ class LightEntity(ToggleEntity): """Return capability attributes.""" data = {} supported_features = self.supported_features + supported_color_modes = self._light_internal_supported_color_modes - if supported_features & SUPPORT_COLOR_TEMP: + if COLOR_MODE_COLOR_TEMP in supported_color_modes: 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 - data[ATTR_SUPPORTED_COLOR_MODES] = sorted( - self._light_internal_supported_color_modes - ) + data[ATTR_SUPPORTED_COLOR_MODES] = sorted(supported_color_modes) return data