mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Migrate avion light to color_mode (#69075)
This commit is contained in:
parent
d96ace82aa
commit
230f0122ff
@ -8,8 +8,8 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
|
COLOR_MODE_BRIGHTNESS,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SUPPORT_BRIGHTNESS,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
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.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
SUPPORT_AVION_LED = SUPPORT_BRIGHTNESS
|
|
||||||
|
|
||||||
DEVICE_SCHEMA = vol.Schema(
|
DEVICE_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(CONF_API_KEY): cv.string,
|
vol.Required(CONF_API_KEY): cv.string,
|
||||||
@ -75,7 +73,8 @@ def setup_platform(
|
|||||||
class AvionLight(LightEntity):
|
class AvionLight(LightEntity):
|
||||||
"""Representation of an Avion light."""
|
"""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_should_poll = False
|
||||||
_attr_assumed_state = True
|
_attr_assumed_state = True
|
||||||
_attr_is_on = True
|
_attr_is_on = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user