From 5e44049994bae297855580be8868c7d30e887efa Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Sun, 3 Apr 2022 14:01:01 +0200 Subject: [PATCH] Migrate decora light to color_mode (#69174) --- homeassistant/components/decora/light.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/decora/light.py b/homeassistant/components/decora/light.py index e29222c8eee..402b4f4c85a 100644 --- a/homeassistant/components/decora/light.py +++ b/homeassistant/components/decora/light.py @@ -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."""