From e66c4e11c98056a151353b9107763faedc526eb6 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:11:43 +0200 Subject: [PATCH] Migrate tellstick light to color_mode (#69528) --- homeassistant/components/tellstick/light.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/tellstick/light.py b/homeassistant/components/tellstick/light.py index 5ead1bf6bda..893e67c897d 100644 --- a/homeassistant/components/tellstick/light.py +++ b/homeassistant/components/tellstick/light.py @@ -3,7 +3,7 @@ from __future__ import annotations from homeassistant.components.light import ( ATTR_BRIGHTNESS, - SUPPORT_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, LightEntity, ) from homeassistant.core import HomeAssistant @@ -18,8 +18,6 @@ from . import ( TellstickDevice, ) -SUPPORT_TELLSTICK = SUPPORT_BRIGHTNESS - def setup_platform( hass: HomeAssistant, @@ -47,6 +45,9 @@ def setup_platform( class TellstickLight(TellstickDevice, LightEntity): """Representation of a Tellstick light.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + def __init__(self, tellcore_device, signal_repetitions): """Initialize the Tellstick light.""" super().__init__(tellcore_device, signal_repetitions) @@ -58,11 +59,6 @@ class TellstickLight(TellstickDevice, LightEntity): """Return the brightness of this light between 0..255.""" return self._brightness - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_TELLSTICK - def _parse_ha_data(self, kwargs): """Turn the value from HA into something useful.""" return kwargs.get(ATTR_BRIGHTNESS)