From 5a0bbedef8eba0acc37508b9c163b84c1b32f5f6 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sat, 23 Apr 2022 22:27:55 +0200 Subject: [PATCH] Use ColorMode enum in group (#70500) --- homeassistant/components/group/light.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/group/light.py b/homeassistant/components/group/light.py index c940a21e98a..b9741085c2d 100644 --- a/homeassistant/components/group/light.py +++ b/homeassistant/components/group/light.py @@ -27,10 +27,9 @@ from homeassistant.components.light import ( ATTR_WHITE, ATTR_WHITE_VALUE, ATTR_XY_COLOR, - COLOR_MODE_BRIGHTNESS, - COLOR_MODE_ONOFF, PLATFORM_SCHEMA, SUPPORT_WHITE_VALUE, + ColorMode, LightEntity, LightEntityFeature, ) @@ -286,10 +285,10 @@ class LightGroup(GroupEntity, LightEntity): if all_color_modes: # Report the most common color mode, select brightness and onoff last color_mode_count = Counter(itertools.chain(all_color_modes)) - if COLOR_MODE_ONOFF in color_mode_count: - color_mode_count[COLOR_MODE_ONOFF] = -1 - if COLOR_MODE_BRIGHTNESS in color_mode_count: - color_mode_count[COLOR_MODE_BRIGHTNESS] = 0 + if ColorMode.ONOFF in color_mode_count: + color_mode_count[ColorMode.ONOFF] = -1 + if ColorMode.BRIGHTNESS in color_mode_count: + color_mode_count[ColorMode.BRIGHTNESS] = 0 self._attr_color_mode = color_mode_count.most_common(1)[0][0] self._attr_supported_color_modes = None