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
16 changes: 7 additions & 9 deletions homeassistant/components/twinkly/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
ATTR_BRIGHTNESS,
ATTR_RGB_COLOR,
ATTR_RGBW_COLOR,
COLOR_MODE_BRIGHTNESS,
COLOR_MODE_RGB,
COLOR_MODE_RGBW,
ColorMode,
LightEntity,
)
from homeassistant.config_entries import ConfigEntry
Expand Down Expand Up @@ -70,16 +68,16 @@ def __init__(
self._conf = conf

if device_info.get(DEV_LED_PROFILE) == DEV_PROFILE_RGBW:
self._attr_supported_color_modes = {COLOR_MODE_RGBW}
self._attr_color_mode = COLOR_MODE_RGBW
self._attr_supported_color_modes = {ColorMode.RGBW}
self._attr_color_mode = ColorMode.RGBW
self._attr_rgbw_color = (255, 255, 255, 0)
elif device_info.get(DEV_LED_PROFILE) == DEV_PROFILE_RGB:
self._attr_supported_color_modes = {COLOR_MODE_RGB}
self._attr_color_mode = COLOR_MODE_RGB
self._attr_supported_color_modes = {ColorMode.RGB}
self._attr_color_mode = ColorMode.RGB
self._attr_rgb_color = (255, 255, 255)
else:
self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
self._attr_color_mode = COLOR_MODE_BRIGHTNESS
self._attr_supported_color_modes = {ColorMode.BRIGHTNESS}
self._attr_color_mode = ColorMode.BRIGHTNESS

# Those are saved in the config entry in order to have meaningful values even
# if the device is currently offline.
Expand Down