Migrate decora light to color_mode (#69174)

This commit is contained in:
Erik Montnemery 2022-04-03 14:01:01 +02:00 committed by GitHub
parent 7e2f024e29
commit 5e44049994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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."""