Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions homeassistant/components/tradfri/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_TRANSITION,
COLOR_MODE_BRIGHTNESS,
COLOR_MODE_COLOR_TEMP,
COLOR_MODE_HS,
ColorMode,
LightEntity,
LightEntityFeature,
)
Expand Down Expand Up @@ -75,16 +73,16 @@ def __init__(
# 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
Expand Down