Migrate avea light to color_mode (#69073)
This commit is contained in:
parent
bfbe0d1d76
commit
d96ace82aa
1 changed files with 3 additions and 5 deletions
|
@ -6,8 +6,7 @@ import avea # pylint: disable=import-error
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_HS_COLOR,
|
ATTR_HS_COLOR,
|
||||||
SUPPORT_BRIGHTNESS,
|
COLOR_MODE_HS,
|
||||||
SUPPORT_COLOR,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
@ -16,8 +15,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
import homeassistant.util.color as color_util
|
import homeassistant.util.color as color_util
|
||||||
|
|
||||||
SUPPORT_AVEA = SUPPORT_BRIGHTNESS | SUPPORT_COLOR
|
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(
|
def setup_platform(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
@ -40,7 +37,8 @@ def setup_platform(
|
||||||
class AveaLight(LightEntity):
|
class AveaLight(LightEntity):
|
||||||
"""Representation of an Avea."""
|
"""Representation of an Avea."""
|
||||||
|
|
||||||
_attr_supported_features = SUPPORT_AVEA
|
_attr_color_mode = COLOR_MODE_HS
|
||||||
|
_attr_supported_color_modes = {COLOR_MODE_HS}
|
||||||
|
|
||||||
def __init__(self, light):
|
def __init__(self, light):
|
||||||
"""Initialize an AveaLight."""
|
"""Initialize an AveaLight."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue