From 4592583988ba5c9f05f0477398c11ca1dc2ed2a7 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 7 Apr 2022 09:43:18 +0200 Subject: [PATCH] Migrate velbus light to color_mode (#69525) * Migrate velbus light to color_mode * Add COLOR_MODE_ONOFF --- homeassistant/components/velbus/light.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/velbus/light.py b/homeassistant/components/velbus/light.py index 2926b30c22f..1fcb23e7485 100644 --- a/homeassistant/components/velbus/light.py +++ b/homeassistant/components/velbus/light.py @@ -13,9 +13,10 @@ from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_FLASH, ATTR_TRANSITION, + COLOR_MODE_BRIGHTNESS, + COLOR_MODE_ONOFF, FLASH_LONG, FLASH_SHORT, - SUPPORT_BRIGHTNESS, SUPPORT_FLASH, SUPPORT_TRANSITION, LightEntity, @@ -49,7 +50,9 @@ class VelbusLight(VelbusEntity, LightEntity): """Representation of a Velbus light.""" _channel: VelbusDimmer - _attr_supported_features = SUPPORT_BRIGHTNESS | SUPPORT_TRANSITION + _attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} + _attr_supported_features = SUPPORT_TRANSITION @property def is_on(self) -> bool: @@ -97,6 +100,8 @@ class VelbusButtonLight(VelbusEntity, LightEntity): _channel: VelbusButton _attr_entity_registry_enabled_default = False _attr_entity_category = EntityCategory.CONFIG + _attr_color_mode = COLOR_MODE_ONOFF + _attr_supported_color_modes = {COLOR_MODE_ONOFF} _attr_supported_features = SUPPORT_FLASH def __init__(self, channel: VelbusChannel) -> None: