Migrate avea light to color_mode (#69073)

This commit is contained in:
Erik Montnemery 2022-04-04 10:51:29 +02:00 committed by GitHub
parent bfbe0d1d76
commit d96ace82aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,8 +6,7 @@ import avea # pylint: disable=import-error
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
COLOR_MODE_HS,
LightEntity,
)
from homeassistant.core import HomeAssistant
@ -16,8 +15,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
import homeassistant.util.color as color_util
SUPPORT_AVEA = SUPPORT_BRIGHTNESS | SUPPORT_COLOR
def setup_platform(
hass: HomeAssistant,
@ -40,7 +37,8 @@ def setup_platform(
class AveaLight(LightEntity):
"""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):
"""Initialize an AveaLight."""