From cbb76824e98094cd8f93eff81bdd79e20ba245e3 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 7 Apr 2022 14:53:23 +0200 Subject: [PATCH] Migrate mystrom light to color_mode (#69428) --- homeassistant/components/mystrom/light.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/mystrom/light.py b/homeassistant/components/mystrom/light.py index 62b82a0214b..53f3342092c 100644 --- a/homeassistant/components/mystrom/light.py +++ b/homeassistant/components/mystrom/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, SUPPORT_FLASH, LightEntity, @@ -29,8 +28,6 @@ _LOGGER = logging.getLogger(__name__) DEFAULT_NAME = "myStrom bulb" -SUPPORT_MYSTROM = SUPPORT_BRIGHTNESS | SUPPORT_EFFECT | SUPPORT_FLASH | SUPPORT_COLOR - EFFECT_RAINBOW = "rainbow" EFFECT_SUNRISE = "sunrise" @@ -74,6 +71,10 @@ async def async_setup_platform( class MyStromLight(LightEntity): """Representation of the myStrom WiFi bulb.""" + _attr_color_mode = COLOR_MODE_HS + _attr_supported_color_modes = {COLOR_MODE_HS} + _attr_supported_features = SUPPORT_EFFECT | SUPPORT_FLASH + def __init__(self, bulb, name, mac): """Initialize the light.""" self._bulb = bulb @@ -95,11 +96,6 @@ class MyStromLight(LightEntity): """Return a unique ID.""" return self._mac - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_MYSTROM - @property def brightness(self): """Return the brightness of the light."""