Use ColorMode enum in unifiprotect (#70547)

pull/70908/head
epenet 2022-04-23 22:01:55 +02:00 committed by GitHub
parent 95f0d14f08
commit 20336ec49c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -6,11 +6,7 @@ from typing import Any
from pyunifiprotect.data import Light
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
COLOR_MODE_BRIGHTNESS,
LightEntity,
)
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -59,8 +55,8 @@ class ProtectLight(ProtectDeviceEntity, LightEntity):
device: Light
_attr_icon = "mdi:spotlight-beam"
_attr_color_mode = COLOR_MODE_BRIGHTNESS
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
_attr_color_mode = ColorMode.BRIGHTNESS
_attr_supported_color_modes = {ColorMode.BRIGHTNESS}
@callback
def _async_update_device_from_protect(self) -> None: