From 88b01b80ce917fcc8fc38979b96893b9ba46c5cc Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Sun, 3 Apr 2022 12:44:21 +0200 Subject: [PATCH] Migrate everlights light to color_mode (#69182) --- homeassistant/components/everlights/light.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/everlights/light.py b/homeassistant/components/everlights/light.py index ad3c5130224..0a900fa37d6 100644 --- a/homeassistant/components/everlights/light.py +++ b/homeassistant/components/everlights/light.py @@ -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."""