Migrate devolo_home_control light to color_mode (#69176)

This commit is contained in:
Erik Montnemery 2022-04-03 13:18:01 +02:00 committed by GitHub
parent 0876239927
commit 422f4fb4ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,7 @@ from devolo_home_control_api.homecontrol import HomeControl
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
SUPPORT_BRIGHTNESS,
COLOR_MODE_BRIGHTNESS,
LightEntity,
)
from homeassistant.config_entries import ConfigEntry
@ -53,7 +53,8 @@ class DevoloLightDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, LightEntity):
element_uid=element_uid,
)
self._attr_supported_features = SUPPORT_BRIGHTNESS
self._attr_color_mode = COLOR_MODE_BRIGHTNESS
self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
self._binary_switch_property = device_instance.binary_switch_property.get(
element_uid.replace("Dimmer", "BinarySwitch")
)