Migrate avion light to color_mode ()

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

View file

@ -8,8 +8,8 @@ import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
COLOR_MODE_BRIGHTNESS,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
LightEntity,
)
from homeassistant.const import (
@ -25,8 +25,6 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
SUPPORT_AVION_LED = SUPPORT_BRIGHTNESS
DEVICE_SCHEMA = vol.Schema(
{
vol.Required(CONF_API_KEY): cv.string,
@ -75,7 +73,8 @@ def setup_platform(
class AvionLight(LightEntity):
"""Representation of an Avion light."""
_attr_supported_features = SUPPORT_AVION_LED
_attr_support_color_mode = COLOR_MODE_BRIGHTNESS
_attr_support_color_modes = {COLOR_MODE_BRIGHTNESS}
_attr_should_poll = False
_attr_assumed_state = True
_attr_is_on = True