mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Use ColorMode enum in velux (#70552)
This commit is contained in:
parent
1b08e509ed
commit
d00d9a2473
@ -2,13 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from pyvlx import Intensity, LighteningDevice
|
from pyvlx import Intensity, LighteningDevice
|
||||||
from pyvlx.node import Node
|
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
|
||||||
ATTR_BRIGHTNESS,
|
|
||||||
COLOR_MODE_BRIGHTNESS,
|
|
||||||
LightEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
@ -33,12 +28,8 @@ async def async_setup_platform(
|
|||||||
class VeluxLight(VeluxEntity, LightEntity):
|
class VeluxLight(VeluxEntity, LightEntity):
|
||||||
"""Representation of a Velux light."""
|
"""Representation of a Velux light."""
|
||||||
|
|
||||||
def __init__(self, node: Node) -> None:
|
_attr_supported_color_modes = {ColorMode.BRIGHTNESS}
|
||||||
"""Initialize the Velux light."""
|
_attr_color_mode = ColorMode.BRIGHTNESS
|
||||||
super().__init__(node)
|
|
||||||
|
|
||||||
self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
|
||||||
self._attr_color_mode = COLOR_MODE_BRIGHTNESS
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def brightness(self):
|
def brightness(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user