Migrate blinkstick light to color_mode (#69076)
This commit is contained in:
parent
230f0122ff
commit
fd6cedeeb8
1 changed files with 3 additions and 5 deletions
|
@ -7,9 +7,8 @@ import voluptuous as vol
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_HS_COLOR,
|
ATTR_HS_COLOR,
|
||||||
|
COLOR_MODE_HS,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SUPPORT_BRIGHTNESS,
|
|
||||||
SUPPORT_COLOR,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_NAME
|
from homeassistant.const import CONF_NAME
|
||||||
|
@ -23,8 +22,6 @@ CONF_SERIAL = "serial"
|
||||||
|
|
||||||
DEFAULT_NAME = "Blinkstick"
|
DEFAULT_NAME = "Blinkstick"
|
||||||
|
|
||||||
SUPPORT_BLINKSTICK = SUPPORT_BRIGHTNESS | SUPPORT_COLOR
|
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
{
|
{
|
||||||
vol.Required(CONF_SERIAL): cv.string,
|
vol.Required(CONF_SERIAL): cv.string,
|
||||||
|
@ -52,7 +49,8 @@ def setup_platform(
|
||||||
class BlinkStickLight(LightEntity):
|
class BlinkStickLight(LightEntity):
|
||||||
"""Representation of a BlinkStick light."""
|
"""Representation of a BlinkStick light."""
|
||||||
|
|
||||||
_attr_supported_features = SUPPORT_BLINKSTICK
|
_attr_color_mode = COLOR_MODE_HS
|
||||||
|
_attr_supported_color_modes = {COLOR_MODE_HS}
|
||||||
|
|
||||||
def __init__(self, stick, name):
|
def __init__(self, stick, name):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue