Use light enums in velbus (#70784)

This commit is contained in:
epenet 2022-04-26 14:33:12 +02:00 committed by GitHub
parent 7ab0dc5177
commit bac69d9e75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,10 +15,9 @@ from homeassistant.components.light import (
ATTR_TRANSITION, ATTR_TRANSITION,
FLASH_LONG, FLASH_LONG,
FLASH_SHORT, FLASH_SHORT,
SUPPORT_FLASH,
SUPPORT_TRANSITION,
ColorMode, ColorMode,
LightEntity, LightEntity,
LightEntityFeature,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
@ -51,7 +50,7 @@ class VelbusLight(VelbusEntity, LightEntity):
_channel: VelbusDimmer _channel: VelbusDimmer
_attr_color_mode = ColorMode.BRIGHTNESS _attr_color_mode = ColorMode.BRIGHTNESS
_attr_supported_color_modes = {ColorMode.BRIGHTNESS} _attr_supported_color_modes = {ColorMode.BRIGHTNESS}
_attr_supported_features = SUPPORT_TRANSITION _attr_supported_features = LightEntityFeature.TRANSITION
@property @property
def is_on(self) -> bool: def is_on(self) -> bool:
@ -101,7 +100,7 @@ class VelbusButtonLight(VelbusEntity, LightEntity):
_attr_entity_category = EntityCategory.CONFIG _attr_entity_category = EntityCategory.CONFIG
_attr_color_mode = ColorMode.ONOFF _attr_color_mode = ColorMode.ONOFF
_attr_supported_color_modes = {ColorMode.ONOFF} _attr_supported_color_modes = {ColorMode.ONOFF}
_attr_supported_features = SUPPORT_FLASH _attr_supported_features = LightEntityFeature.FLASH
def __init__(self, channel: VelbusChannel) -> None: def __init__(self, channel: VelbusChannel) -> None:
"""Initialize the button light (led).""" """Initialize the button light (led)."""