Use ColorMode enum in velbus (#70550)

This commit is contained in:
epenet 2022-04-23 22:01:35 +02:00 committed by GitHub
parent 3bbd08d9c9
commit 95f0d14f08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,12 +13,11 @@ 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_FLASH, SUPPORT_FLASH,
SUPPORT_TRANSITION, SUPPORT_TRANSITION,
ColorMode,
LightEntity, LightEntity,
) )
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
@ -50,8 +49,8 @@ class VelbusLight(VelbusEntity, LightEntity):
"""Representation of a Velbus light.""" """Representation of a Velbus light."""
_channel: VelbusDimmer _channel: VelbusDimmer
_attr_color_mode = COLOR_MODE_BRIGHTNESS _attr_color_mode = ColorMode.BRIGHTNESS
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} _attr_supported_color_modes = {ColorMode.BRIGHTNESS}
_attr_supported_features = SUPPORT_TRANSITION _attr_supported_features = SUPPORT_TRANSITION
@property @property
@ -100,8 +99,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_color_mode = ColorMode.ONOFF
_attr_supported_color_modes = {COLOR_MODE_ONOFF} _attr_supported_color_modes = {ColorMode.ONOFF}
_attr_supported_features = SUPPORT_FLASH _attr_supported_features = SUPPORT_FLASH
def __init__(self, channel: VelbusChannel) -> None: def __init__(self, channel: VelbusChannel) -> None: