mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 11:17:53 +00:00
Migrate everlights light to color_mode (#69182)
This commit is contained in:
parent
beb5184720
commit
88b01b80ce
@ -11,9 +11,8 @@ from homeassistant.components.light import (
|
|||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_EFFECT,
|
ATTR_EFFECT,
|
||||||
ATTR_HS_COLOR,
|
ATTR_HS_COLOR,
|
||||||
|
COLOR_MODE_HS,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SUPPORT_BRIGHTNESS,
|
|
||||||
SUPPORT_COLOR,
|
|
||||||
SUPPORT_EFFECT,
|
SUPPORT_EFFECT,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
@ -28,8 +27,6 @@ import homeassistant.util.color as color_util
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
SUPPORT_EVERLIGHTS = SUPPORT_EFFECT | SUPPORT_BRIGHTNESS | SUPPORT_COLOR
|
|
||||||
|
|
||||||
SCAN_INTERVAL = timedelta(minutes=1)
|
SCAN_INTERVAL = timedelta(minutes=1)
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
@ -77,6 +74,10 @@ async def async_setup_platform(
|
|||||||
class EverLightsLight(LightEntity):
|
class EverLightsLight(LightEntity):
|
||||||
"""Representation of a Flux light."""
|
"""Representation of a Flux light."""
|
||||||
|
|
||||||
|
_attr_color_mode = COLOR_MODE_HS
|
||||||
|
_attr_supported_color_modes = {COLOR_MODE_HS}
|
||||||
|
_attr_supported_features = SUPPORT_EFFECT
|
||||||
|
|
||||||
def __init__(self, api, channel, status, effects):
|
def __init__(self, api, channel, status, effects):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
self._api = api
|
self._api = api
|
||||||
@ -125,11 +126,6 @@ class EverLightsLight(LightEntity):
|
|||||||
"""Return the effect property."""
|
"""Return the effect property."""
|
||||||
return self._effect
|
return self._effect
|
||||||
|
|
||||||
@property
|
|
||||||
def supported_features(self):
|
|
||||||
"""Flag supported features."""
|
|
||||||
return SUPPORT_EVERLIGHTS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def effect_list(self):
|
def effect_list(self):
|
||||||
"""Return the list of supported effects."""
|
"""Return the list of supported effects."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user