Migrate mystrom light to color_mode (#69428)
This commit is contained in:
parent
0c72a39e23
commit
cbb76824e9
1 changed files with 5 additions and 9 deletions
|
@ -11,9 +11,8 @@ from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_EFFECT,
|
ATTR_EFFECT,
|
||||||
ATTR_HS_COLOR,
|
ATTR_HS_COLOR,
|
||||||
|
COLOR_MODE_HS,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SUPPORT_BRIGHTNESS,
|
|
||||||
SUPPORT_COLOR,
|
|
||||||
SUPPORT_EFFECT,
|
SUPPORT_EFFECT,
|
||||||
SUPPORT_FLASH,
|
SUPPORT_FLASH,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
|
@ -29,8 +28,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DEFAULT_NAME = "myStrom bulb"
|
DEFAULT_NAME = "myStrom bulb"
|
||||||
|
|
||||||
SUPPORT_MYSTROM = SUPPORT_BRIGHTNESS | SUPPORT_EFFECT | SUPPORT_FLASH | SUPPORT_COLOR
|
|
||||||
|
|
||||||
EFFECT_RAINBOW = "rainbow"
|
EFFECT_RAINBOW = "rainbow"
|
||||||
EFFECT_SUNRISE = "sunrise"
|
EFFECT_SUNRISE = "sunrise"
|
||||||
|
|
||||||
|
@ -74,6 +71,10 @@ async def async_setup_platform(
|
||||||
class MyStromLight(LightEntity):
|
class MyStromLight(LightEntity):
|
||||||
"""Representation of the myStrom WiFi bulb."""
|
"""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):
|
def __init__(self, bulb, name, mac):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
self._bulb = bulb
|
self._bulb = bulb
|
||||||
|
@ -95,11 +96,6 @@ class MyStromLight(LightEntity):
|
||||||
"""Return a unique ID."""
|
"""Return a unique ID."""
|
||||||
return self._mac
|
return self._mac
|
||||||
|
|
||||||
@property
|
|
||||||
def supported_features(self):
|
|
||||||
"""Flag supported features."""
|
|
||||||
return SUPPORT_MYSTROM
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def brightness(self):
|
def brightness(self):
|
||||||
"""Return the brightness of the light."""
|
"""Return the brightness of the light."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue