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
18 changes: 8 additions & 10 deletions homeassistant/components/eufy/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
COLOR_MODE_BRIGHTNESS,
COLOR_MODE_COLOR_TEMP,
COLOR_MODE_HS,
ColorMode,
LightEntity,
)
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -54,11 +52,11 @@ def __init__(self, device):
self._bulb = lakeside.bulb(self._address, self._code, self._type)
self._colormode = False
if self._type == "T1011":
self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
self._attr_supported_color_modes = {ColorMode.BRIGHTNESS}
elif self._type == "T1012":
self._attr_supported_color_modes = {COLOR_MODE_COLOR_TEMP}
self._attr_supported_color_modes = {ColorMode.COLOR_TEMP}
else: # T1013
self._attr_supported_color_modes = {COLOR_MODE_COLOR_TEMP, COLOR_MODE_HS}
self._attr_supported_color_modes = {ColorMode.COLOR_TEMP, ColorMode.HS}
self._bulb.connect()

def update(self):
Expand Down Expand Up @@ -121,13 +119,13 @@ def hs_color(self):
def color_mode(self) -> str | None:
"""Return the color mode of the light."""
if self._type == "T1011":
return COLOR_MODE_BRIGHTNESS
return ColorMode.BRIGHTNESS
if self._type == "T1012":
return COLOR_MODE_COLOR_TEMP
return ColorMode.COLOR_TEMP
# T1013
if not self._colormode:
return COLOR_MODE_COLOR_TEMP
return COLOR_MODE_HS
return ColorMode.COLOR_TEMP
return ColorMode.HS

def turn_on(self, **kwargs):
"""Turn the specified light on."""
Expand Down