From dffb3cc1969c45a33424ed1fc5d97996f48d9191 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 4 Apr 2022 18:18:50 +0200 Subject: [PATCH] Migrate futurenow light to color_mode (#69257) --- homeassistant/components/futurenow/light.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/futurenow/light.py b/homeassistant/components/futurenow/light.py index 4cd61865706..8575017f7e3 100644 --- a/homeassistant/components/futurenow/light.py +++ b/homeassistant/components/futurenow/light.py @@ -6,8 +6,9 @@ import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, + COLOR_MODE_ONOFF, PLATFORM_SCHEMA, - SUPPORT_BRIGHTNESS, LightEntity, ) from homeassistant.const import CONF_DEVICES, CONF_HOST, CONF_NAME, CONF_PORT @@ -106,11 +107,16 @@ class FutureNowLight(LightEntity): return self._brightness @property - def supported_features(self): - """Flag supported features.""" + def color_mode(self) -> str: + """Return the color mode of the light.""" if self._dimmable: - return SUPPORT_BRIGHTNESS - return 0 + return COLOR_MODE_BRIGHTNESS + return COLOR_MODE_ONOFF + + @property + def supported_color_modes(self) -> set[str] | None: + """Flag supported color modes.""" + return {self.color_mode} def turn_on(self, **kwargs): """Turn the light on."""