From c289383b7d86fdfd46da4923204c5aa47967182b Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 6 Apr 2022 15:09:00 +0200 Subject: [PATCH] Migrate litejet light to color_mode --- homeassistant/components/litejet/light.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/litejet/light.py b/homeassistant/components/litejet/light.py index 49964b93b8810..ad638653a9434 100644 --- a/homeassistant/components/litejet/light.py +++ b/homeassistant/components/litejet/light.py @@ -4,7 +4,7 @@ from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_TRANSITION, - SUPPORT_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, SUPPORT_TRANSITION, LightEntity, ) @@ -41,6 +41,10 @@ def get_entities(system): class LiteJetLight(LightEntity): """Representation of a single LiteJet light.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + _attr_supported_features = SUPPORT_TRANSITION + def __init__(self, config_entry, lj, i, name): # pylint: disable=invalid-name """Initialize a LiteJet light.""" self._config_entry = config_entry @@ -63,11 +67,6 @@ def _on_load_changed(self): _LOGGER.debug("Updating due to notification for %s", self._name) self.schedule_update_ha_state(True) - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_BRIGHTNESS | SUPPORT_TRANSITION - @property def name(self): """Return the light's name."""