mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Migrate velbus light to color_mode (#69525)
* Migrate velbus light to color_mode * Add COLOR_MODE_ONOFF
This commit is contained in:
parent
d614ccd161
commit
4592583988
@ -13,9 +13,10 @@ from homeassistant.components.light import (
|
|||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_FLASH,
|
ATTR_FLASH,
|
||||||
ATTR_TRANSITION,
|
ATTR_TRANSITION,
|
||||||
|
COLOR_MODE_BRIGHTNESS,
|
||||||
|
COLOR_MODE_ONOFF,
|
||||||
FLASH_LONG,
|
FLASH_LONG,
|
||||||
FLASH_SHORT,
|
FLASH_SHORT,
|
||||||
SUPPORT_BRIGHTNESS,
|
|
||||||
SUPPORT_FLASH,
|
SUPPORT_FLASH,
|
||||||
SUPPORT_TRANSITION,
|
SUPPORT_TRANSITION,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
@ -49,7 +50,9 @@ class VelbusLight(VelbusEntity, LightEntity):
|
|||||||
"""Representation of a Velbus light."""
|
"""Representation of a Velbus light."""
|
||||||
|
|
||||||
_channel: VelbusDimmer
|
_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
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
@ -97,6 +100,8 @@ class VelbusButtonLight(VelbusEntity, LightEntity):
|
|||||||
_channel: VelbusButton
|
_channel: VelbusButton
|
||||||
_attr_entity_registry_enabled_default = False
|
_attr_entity_registry_enabled_default = False
|
||||||
_attr_entity_category = EntityCategory.CONFIG
|
_attr_entity_category = EntityCategory.CONFIG
|
||||||
|
_attr_color_mode = COLOR_MODE_ONOFF
|
||||||
|
_attr_supported_color_modes = {COLOR_MODE_ONOFF}
|
||||||
_attr_supported_features = SUPPORT_FLASH
|
_attr_supported_features = SUPPORT_FLASH
|
||||||
|
|
||||||
def __init__(self, channel: VelbusChannel) -> None:
|
def __init__(self, channel: VelbusChannel) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user