mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Use light enums in nanoleaf (#70795)
This commit is contained in:
parent
67b411d2b2
commit
01efbdb104
@ -12,10 +12,9 @@ from homeassistant.components.light import (
|
|||||||
ATTR_EFFECT,
|
ATTR_EFFECT,
|
||||||
ATTR_HS_COLOR,
|
ATTR_HS_COLOR,
|
||||||
ATTR_TRANSITION,
|
ATTR_TRANSITION,
|
||||||
SUPPORT_EFFECT,
|
|
||||||
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
|
||||||
@ -46,7 +45,7 @@ class NanoleafLight(NanoleafEntity, LightEntity):
|
|||||||
"""Representation of a Nanoleaf Light."""
|
"""Representation of a Nanoleaf Light."""
|
||||||
|
|
||||||
_attr_supported_color_modes = {ColorMode.COLOR_TEMP, ColorMode.HS}
|
_attr_supported_color_modes = {ColorMode.COLOR_TEMP, ColorMode.HS}
|
||||||
_attr_supported_features = SUPPORT_EFFECT | SUPPORT_TRANSITION
|
_attr_supported_features = LightEntityFeature.EFFECT | LightEntityFeature.TRANSITION
|
||||||
|
|
||||||
def __init__(self, nanoleaf: Nanoleaf, coordinator: DataUpdateCoordinator) -> None:
|
def __init__(self, nanoleaf: Nanoleaf, coordinator: DataUpdateCoordinator) -> None:
|
||||||
"""Initialize the Nanoleaf light."""
|
"""Initialize the Nanoleaf light."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user