Migrate lw12wifi light to color_mode (#69424)
This commit is contained in:
parent
5110565488
commit
09f4e31343
1 changed files with 5 additions and 11 deletions
|
@ -11,9 +11,8 @@ from homeassistant.components.light import (
|
|||
ATTR_EFFECT,
|
||||
ATTR_HS_COLOR,
|
||||
ATTR_TRANSITION,
|
||||
COLOR_MODE_HS,
|
||||
PLATFORM_SCHEMA,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
SUPPORT_COLOR,
|
||||
SUPPORT_EFFECT,
|
||||
SUPPORT_TRANSITION,
|
||||
LightEntity,
|
||||
|
@ -59,6 +58,10 @@ def setup_platform(
|
|||
class LW12WiFi(LightEntity):
|
||||
"""LW-12 WiFi LED Controller."""
|
||||
|
||||
_attr_color_mode = COLOR_MODE_HS
|
||||
_attr_supported_color_modes = {COLOR_MODE_HS}
|
||||
_attr_supported_features = SUPPORT_EFFECT | SUPPORT_TRANSITION
|
||||
|
||||
def __init__(self, name, lw12_light):
|
||||
"""Initialise LW-12 WiFi LED Controller.
|
||||
|
||||
|
@ -71,10 +74,6 @@ class LW12WiFi(LightEntity):
|
|||
self._effect = None
|
||||
self._rgb_color = [255, 255, 255]
|
||||
self._brightness = 255
|
||||
# Setup feature list
|
||||
self._supported_features = (
|
||||
SUPPORT_BRIGHTNESS | SUPPORT_EFFECT | SUPPORT_COLOR | SUPPORT_TRANSITION
|
||||
)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
|
@ -103,11 +102,6 @@ class LW12WiFi(LightEntity):
|
|||
"""Return true if light is on."""
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Return a list of supported features."""
|
||||
return self._supported_features
|
||||
|
||||
@property
|
||||
def effect_list(self):
|
||||
"""Return a list of available effects.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue