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
20 changes: 13 additions & 7 deletions homeassistant/components/vera/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ENTITY_ID_FORMAT,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
ColorMode,
LightEntity,
)
from homeassistant.config_entries import ConfigEntry
Expand Down Expand Up @@ -63,11 +62,18 @@ def hs_color(self) -> tuple[float, float] | None:
return self._color

@property
def supported_features(self) -> int:
"""Flag supported features."""
if self._color:
return SUPPORT_BRIGHTNESS | SUPPORT_COLOR
return SUPPORT_BRIGHTNESS
def color_mode(self) -> ColorMode:
"""Return the color mode of the light."""
if self.vera_device.is_dimmable:
if self._color:
return ColorMode.HS
return ColorMode.BRIGHTNESS
return ColorMode.ONOFF

@property
def supported_color_modes(self) -> set[ColorMode]:
"""Flag supported color modes."""
return {self.color_mode}

def turn_on(self, **kwargs: Any) -> None:
"""Turn the light on."""
Expand Down