From 2cc3bfa056e65bca705cf6caeaec406dfb80be21 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:18:06 +0200 Subject: [PATCH] Migrate sisyphus light to color_mode (#69521) --- homeassistant/components/sisyphus/light.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/sisyphus/light.py b/homeassistant/components/sisyphus/light.py index be905c0c8b1..ba879c6e02e 100644 --- a/homeassistant/components/sisyphus/light.py +++ b/homeassistant/components/sisyphus/light.py @@ -5,7 +5,7 @@ import logging import aiohttp -from homeassistant.components.light import SUPPORT_BRIGHTNESS, LightEntity +from homeassistant.components.light import COLOR_MODE_BRIGHTNESS, LightEntity from homeassistant.const import CONF_HOST from homeassistant.core import HomeAssistant from homeassistant.exceptions import PlatformNotReady @@ -16,8 +16,6 @@ from . import DATA_SISYPHUS _LOGGER = logging.getLogger(__name__) -SUPPORTED_FEATURES = SUPPORT_BRIGHTNESS - async def async_setup_platform( hass: HomeAssistant, @@ -41,6 +39,9 @@ async def async_setup_platform( class SisyphusLight(LightEntity): """Representation of a Sisyphus table as a light.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + def __init__(self, name, table): """Initialize the Sisyphus table.""" self._name = name @@ -79,11 +80,6 @@ class SisyphusLight(LightEntity): """Return the current brightness of the table's ring light.""" return self._table.brightness * 255 - @property - def supported_features(self): - """Return the features supported by the table; i.e. brightness.""" - return SUPPORTED_FEATURES - async def async_turn_off(self, **kwargs): """Put the table to sleep.""" await self._table.sleep()