From 9335b9a52ef0fdcb63e328274e34439cd135692c Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Sun, 3 Apr 2022 13:44:38 +0200 Subject: [PATCH] Migrate enocean light to color_mode (#69180) --- homeassistant/components/enocean/light.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/enocean/light.py b/homeassistant/components/enocean/light.py index 92887be9b45..167222f98a7 100644 --- a/homeassistant/components/enocean/light.py +++ b/homeassistant/components/enocean/light.py @@ -7,8 +7,8 @@ import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, + COLOR_MODE_BRIGHTNESS, PLATFORM_SCHEMA, - SUPPORT_BRIGHTNESS, LightEntity, ) from homeassistant.const import CONF_ID, CONF_NAME @@ -22,7 +22,6 @@ from .device import EnOceanEntity CONF_SENDER_ID = "sender_id" DEFAULT_NAME = "EnOcean Light" -SUPPORT_ENOCEAN = SUPPORT_BRIGHTNESS PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { @@ -50,6 +49,9 @@ def setup_platform( class EnOceanLight(EnOceanEntity, LightEntity): """Representation of an EnOcean light source.""" + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + def __init__(self, sender_id, dev_id, dev_name): """Initialize the EnOcean light source.""" super().__init__(dev_id, dev_name) @@ -76,11 +78,6 @@ class EnOceanLight(EnOceanEntity, LightEntity): """If light is on.""" return self._on_state - @property - def supported_features(self): - """Flag supported features.""" - return SUPPORT_ENOCEAN - def turn_on(self, **kwargs): """Turn the light source on or sets a specific dimmer value.""" if (brightness := kwargs.get(ATTR_BRIGHTNESS)) is not None: