mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Migrate WLED to use EntityFeature enums (#69219)
This commit is contained in:
parent
76247414bf
commit
614076cdf1
@ -13,9 +13,8 @@ from homeassistant.components.light import (
|
|||||||
COLOR_MODE_BRIGHTNESS,
|
COLOR_MODE_BRIGHTNESS,
|
||||||
COLOR_MODE_RGB,
|
COLOR_MODE_RGB,
|
||||||
COLOR_MODE_RGBW,
|
COLOR_MODE_RGBW,
|
||||||
SUPPORT_EFFECT,
|
|
||||||
SUPPORT_TRANSITION,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
|
LightEntityFeature,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
@ -55,7 +54,7 @@ class WLEDMasterLight(WLEDEntity, LightEntity):
|
|||||||
|
|
||||||
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||||
_attr_icon = "mdi:led-strip-variant"
|
_attr_icon = "mdi:led-strip-variant"
|
||||||
_attr_supported_features = SUPPORT_TRANSITION
|
_attr_supported_features = LightEntityFeature.TRANSITION
|
||||||
|
|
||||||
def __init__(self, coordinator: WLEDDataUpdateCoordinator) -> None:
|
def __init__(self, coordinator: WLEDDataUpdateCoordinator) -> None:
|
||||||
"""Initialize WLED master light."""
|
"""Initialize WLED master light."""
|
||||||
@ -105,7 +104,7 @@ class WLEDMasterLight(WLEDEntity, LightEntity):
|
|||||||
class WLEDSegmentLight(WLEDEntity, LightEntity):
|
class WLEDSegmentLight(WLEDEntity, LightEntity):
|
||||||
"""Defines a WLED light based on a segment."""
|
"""Defines a WLED light based on a segment."""
|
||||||
|
|
||||||
_attr_supported_features = SUPPORT_EFFECT | SUPPORT_TRANSITION
|
_attr_supported_features = LightEntityFeature.EFFECT | LightEntityFeature.TRANSITION
|
||||||
_attr_icon = "mdi:led-strip-variant"
|
_attr_icon = "mdi:led-strip-variant"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user