From 9a38172d1f7489fe370c9353769e2ab74bc3f54d Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sat, 23 Apr 2022 21:46:24 +0200 Subject: [PATCH] Use ColorMode enum in tradfri (#70544) --- homeassistant/components/tradfri/light.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/tradfri/light.py b/homeassistant/components/tradfri/light.py index 6c92f419cb6..161c7d8f25d 100644 --- a/homeassistant/components/tradfri/light.py +++ b/homeassistant/components/tradfri/light.py @@ -11,9 +11,7 @@ from homeassistant.components.light import ( ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_TRANSITION, - COLOR_MODE_BRIGHTNESS, - COLOR_MODE_COLOR_TEMP, - COLOR_MODE_HS, + ColorMode, LightEntity, LightEntityFeature, ) @@ -75,16 +73,16 @@ class TradfriLight(TradfriBaseEntity, LightEntity): # Calculate supported color modes self._attr_supported_color_modes = set() if self._device.light_control.can_set_color: - self._attr_supported_color_modes.add(COLOR_MODE_HS) + self._attr_supported_color_modes.add(ColorMode.HS) if self._device.light_control.can_set_temp: - self._attr_supported_color_modes.add(COLOR_MODE_COLOR_TEMP) + self._attr_supported_color_modes.add(ColorMode.COLOR_TEMP) if ( not self._attr_supported_color_modes and self._device.light_control.can_set_dimmer ): # Must be the only supported mode according to docs for - # COLOR_MODE_BRIGHTNESS - self._attr_supported_color_modes.add(COLOR_MODE_BRIGHTNESS) + # ColorMode.BRIGHTNESS + self._attr_supported_color_modes.add(ColorMode.BRIGHTNESS) if self._device_control: self._attr_min_mireds = self._device_control.min_mireds