Migrate smarttub light to color_mode (#69529)
This commit is contained in:
parent
766e6f2e9c
commit
3828c36202
1 changed files with 5 additions and 2 deletions
|
@ -4,8 +4,8 @@ from smarttub import SpaLight
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_EFFECT,
|
ATTR_EFFECT,
|
||||||
|
COLOR_MODE_BRIGHTNESS,
|
||||||
EFFECT_COLORLOOP,
|
EFFECT_COLORLOOP,
|
||||||
SUPPORT_BRIGHTNESS,
|
|
||||||
SUPPORT_EFFECT,
|
SUPPORT_EFFECT,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
|
@ -43,6 +43,9 @@ async def async_setup_entry(
|
||||||
class SmartTubLight(SmartTubEntity, LightEntity):
|
class SmartTubLight(SmartTubEntity, LightEntity):
|
||||||
"""A light on a spa."""
|
"""A light on a spa."""
|
||||||
|
|
||||||
|
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||||
|
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||||
|
|
||||||
def __init__(self, coordinator, light):
|
def __init__(self, coordinator, light):
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
super().__init__(coordinator, light.spa, "light")
|
super().__init__(coordinator, light.spa, "light")
|
||||||
|
@ -89,7 +92,7 @@ class SmartTubLight(SmartTubEntity, LightEntity):
|
||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
return SUPPORT_BRIGHTNESS | SUPPORT_EFFECT
|
return SUPPORT_EFFECT
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def effect(self):
|
def effect(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue