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
22 changes: 15 additions & 7 deletions homeassistant/components/iaqualink/light.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""Support for Aqualink pool lights."""
import logging
from __future__ import annotations

from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_EFFECT,
COLOR_MODE_BRIGHTNESS,
COLOR_MODE_ONOFF,
DOMAIN,
SUPPORT_BRIGHTNESS,
SUPPORT_EFFECT,
LightEntity,
)
Expand All @@ -17,8 +18,6 @@
from .const import DOMAIN as AQUALINK_DOMAIN
from .utils import await_or_reraise

_LOGGER = logging.getLogger(__name__)

PARALLEL_UPDATES = 0


Expand Down Expand Up @@ -88,11 +87,20 @@ def effect_list(self) -> list:
return list(self.dev.supported_light_effects)

@property
def supported_features(self) -> int:
"""Return the list of features supported by the light."""
def color_mode(self) -> str:
"""Return the color mode of the light."""
if self.dev.is_dimmer:
return SUPPORT_BRIGHTNESS
return COLOR_MODE_BRIGHTNESS
return COLOR_MODE_ONOFF

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

@property
def supported_features(self) -> int:
"""Return the list of features supported by the light."""
if self.dev.is_color:
return SUPPORT_EFFECT

Expand Down