mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use light enums in smarttub (#70789)
This commit is contained in:
parent
5d8b35face
commit
9a7f6393aa
@ -5,9 +5,9 @@ from homeassistant.components.light import (
|
|||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_EFFECT,
|
ATTR_EFFECT,
|
||||||
EFFECT_COLORLOOP,
|
EFFECT_COLORLOOP,
|
||||||
SUPPORT_EFFECT,
|
|
||||||
ColorMode,
|
ColorMode,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
|
LightEntityFeature,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -45,6 +45,7 @@ class SmartTubLight(SmartTubEntity, LightEntity):
|
|||||||
|
|
||||||
_attr_color_mode = ColorMode.BRIGHTNESS
|
_attr_color_mode = ColorMode.BRIGHTNESS
|
||||||
_attr_supported_color_modes = {ColorMode.BRIGHTNESS}
|
_attr_supported_color_modes = {ColorMode.BRIGHTNESS}
|
||||||
|
_attr_supported_features = LightEntityFeature.EFFECT
|
||||||
|
|
||||||
def __init__(self, coordinator, light):
|
def __init__(self, coordinator, light):
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
@ -89,11 +90,6 @@ class SmartTubLight(SmartTubEntity, LightEntity):
|
|||||||
"""Return true if the light is on."""
|
"""Return true if the light is on."""
|
||||||
return self.light.mode != SpaLight.LightMode.OFF
|
return self.light.mode != SpaLight.LightMode.OFF
|
||||||
|
|
||||||
@property
|
|
||||||
def supported_features(self):
|
|
||||||
"""Flag supported features."""
|
|
||||||
return SUPPORT_EFFECT
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def effect(self):
|
def effect(self):
|
||||||
"""Return the current effect."""
|
"""Return the current effect."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user