Correct min and max mired for light with color_mode support (#49572)

pull/49577/head
Erik Montnemery 2021-04-23 01:47:33 +02:00 committed by GitHub
parent d28b959a09
commit b3c9d854f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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