Use light enums in upb (#70786)

This commit is contained in:
epenet 2022-04-26 14:32:54 +02:00 committed by GitHub
parent fe0120b65a
commit 56e0b8dbb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,10 +3,9 @@ from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_BRIGHTNESS,
ATTR_FLASH, ATTR_FLASH,
ATTR_TRANSITION, ATTR_TRANSITION,
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
@ -68,11 +67,11 @@ class UpbLight(UpbAttachedEntity, LightEntity):
return {self.color_mode} return {self.color_mode}
@property @property
def supported_features(self): def supported_features(self) -> int:
"""Flag supported features.""" """Flag supported features."""
if self._element.dimmable: if self._element.dimmable:
return SUPPORT_TRANSITION | SUPPORT_FLASH return LightEntityFeature.TRANSITION | LightEntityFeature.FLASH
return SUPPORT_FLASH return LightEntityFeature.FLASH
@property @property
def brightness(self): def brightness(self):