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
13 changes: 9 additions & 4 deletions homeassistant/components/qwikswitch/light.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Support for Qwikswitch Relays and Dimmers."""
from __future__ import annotations

from homeassistant.components.light import SUPPORT_BRIGHTNESS, LightEntity
from homeassistant.components.light import ColorMode, LightEntity
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
Expand Down Expand Up @@ -33,6 +33,11 @@ def brightness(self):
return self.device.value if self.device.is_dimmer else None

@property
def supported_features(self):
"""Flag supported features."""
return SUPPORT_BRIGHTNESS if self.device.is_dimmer else 0
def color_mode(self) -> ColorMode:
"""Return the color mode of the light."""
return ColorMode.BRIGHTNESS if self.device.is_dimmer else ColorMode.ONOFF

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