mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Use ColorMode enum in iaqualink (#70510)
This commit is contained in:
parent
346a385f1a
commit
149cc01ed3
@ -4,9 +4,8 @@ from __future__ import annotations
|
|||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_EFFECT,
|
ATTR_EFFECT,
|
||||||
COLOR_MODE_BRIGHTNESS,
|
|
||||||
COLOR_MODE_ONOFF,
|
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
|
ColorMode,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
LightEntityFeature,
|
LightEntityFeature,
|
||||||
)
|
)
|
||||||
@ -87,11 +86,11 @@ class HassAqualinkLight(AqualinkEntity, LightEntity):
|
|||||||
return list(self.dev.supported_light_effects)
|
return list(self.dev.supported_light_effects)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def color_mode(self) -> str:
|
def color_mode(self) -> ColorMode:
|
||||||
"""Return the color mode of the light."""
|
"""Return the color mode of the light."""
|
||||||
if self.dev.is_dimmer:
|
if self.dev.is_dimmer:
|
||||||
return COLOR_MODE_BRIGHTNESS
|
return ColorMode.BRIGHTNESS
|
||||||
return COLOR_MODE_ONOFF
|
return ColorMode.ONOFF
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_color_modes(self) -> set[str] | None:
|
def supported_color_modes(self) -> set[str] | None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user