mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Migrate lw12wifi light to color_mode (#69424)
This commit is contained in:
parent
5110565488
commit
09f4e31343
@ -11,9 +11,8 @@ from homeassistant.components.light import (
|
|||||||
ATTR_EFFECT,
|
ATTR_EFFECT,
|
||||||
ATTR_HS_COLOR,
|
ATTR_HS_COLOR,
|
||||||
ATTR_TRANSITION,
|
ATTR_TRANSITION,
|
||||||
|
COLOR_MODE_HS,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SUPPORT_BRIGHTNESS,
|
|
||||||
SUPPORT_COLOR,
|
|
||||||
SUPPORT_EFFECT,
|
SUPPORT_EFFECT,
|
||||||
SUPPORT_TRANSITION,
|
SUPPORT_TRANSITION,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
@ -59,6 +58,10 @@ def setup_platform(
|
|||||||
class LW12WiFi(LightEntity):
|
class LW12WiFi(LightEntity):
|
||||||
"""LW-12 WiFi LED Controller."""
|
"""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):
|
def __init__(self, name, lw12_light):
|
||||||
"""Initialise LW-12 WiFi LED Controller.
|
"""Initialise LW-12 WiFi LED Controller.
|
||||||
|
|
||||||
@ -71,10 +74,6 @@ class LW12WiFi(LightEntity):
|
|||||||
self._effect = None
|
self._effect = None
|
||||||
self._rgb_color = [255, 255, 255]
|
self._rgb_color = [255, 255, 255]
|
||||||
self._brightness = 255
|
self._brightness = 255
|
||||||
# Setup feature list
|
|
||||||
self._supported_features = (
|
|
||||||
SUPPORT_BRIGHTNESS | SUPPORT_EFFECT | SUPPORT_COLOR | SUPPORT_TRANSITION
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -103,11 +102,6 @@ class LW12WiFi(LightEntity):
|
|||||||
"""Return true if light is on."""
|
"""Return true if light is on."""
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
|
||||||
def supported_features(self):
|
|
||||||
"""Return a list of supported features."""
|
|
||||||
return self._supported_features
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def effect_list(self):
|
def effect_list(self):
|
||||||
"""Return a list of available effects.
|
"""Return a list of available effects.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user