mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Use light enums in upb (#70786)
This commit is contained in:
parent
fe0120b65a
commit
56e0b8dbb5
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user