Migrate everlights light to color_mode (#69182)

This commit is contained in:
Erik Montnemery 2022-04-03 12:44:21 +02:00 committed by GitHub
parent beb5184720
commit 88b01b80ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,9 +11,8 @@ from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_EFFECT,
ATTR_HS_COLOR,
COLOR_MODE_HS,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_EFFECT,
LightEntity,
)
@ -28,8 +27,6 @@ import homeassistant.util.color as color_util
_LOGGER = logging.getLogger(__name__)
SUPPORT_EVERLIGHTS = SUPPORT_EFFECT | SUPPORT_BRIGHTNESS | SUPPORT_COLOR
SCAN_INTERVAL = timedelta(minutes=1)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
@ -77,6 +74,10 @@ async def async_setup_platform(
class EverLightsLight(LightEntity):
"""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):
"""Initialize the light."""
self._api = api
@ -125,11 +126,6 @@ class EverLightsLight(LightEntity):
"""Return the effect property."""
return self._effect
@property
def supported_features(self):
"""Flag supported features."""
return SUPPORT_EVERLIGHTS
@property
def effect_list(self):
"""Return the list of supported effects."""