Migrate mystrom light to color_mode (#69428)

This commit is contained in:
Erik Montnemery 2022-04-07 14:53:23 +02:00 committed by GitHub
parent 0c72a39e23
commit cbb76824e9
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,
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."""