mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Migrate decora light to color_mode (#69174)
This commit is contained in:
parent
7e2f024e29
commit
5e44049994
@ -13,8 +13,8 @@ import voluptuous as vol
|
||||
from homeassistant import util
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
COLOR_MODE_BRIGHTNESS,
|
||||
PLATFORM_SCHEMA,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY, CONF_DEVICES, CONF_NAME
|
||||
@ -25,8 +25,6 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SUPPORT_DECORA_LED = SUPPORT_BRIGHTNESS
|
||||
|
||||
|
||||
def _name_validator(config):
|
||||
"""Validate the name."""
|
||||
@ -98,6 +96,9 @@ def setup_platform(
|
||||
class DecoraLight(LightEntity):
|
||||
"""Representation of an Decora light."""
|
||||
|
||||
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
||||
|
||||
def __init__(self, device):
|
||||
"""Initialize the light."""
|
||||
|
||||
@ -128,11 +129,6 @@ class DecoraLight(LightEntity):
|
||||
"""Return the brightness of this light between 0..255."""
|
||||
return self._brightness
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_DECORA_LED
|
||||
|
||||
@property
|
||||
def assumed_state(self):
|
||||
"""We can read the actual state."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user