From e987791265382396b17042521419caefaf2fff75 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 6 Apr 2022 15:20:07 +0200 Subject: [PATCH] Migrate mystrom light to color_mode --- 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 62b82a0214b0b0..53f3342092c2dc 100644 --- a/homeassistant/components/mystrom/light.py +++ b/homeassistant/components/mystrom/light.py @@ -11,9 +11,8 @@ 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 @@ 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 @@ def unique_id(self): """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."""