From d00d9a2473f95bceace95d8ef267ab6d2868a74b Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sat, 23 Apr 2022 22:02:25 +0200 Subject: [PATCH] Use ColorMode enum in velux (#70552) --- homeassistant/components/velux/light.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/velux/light.py b/homeassistant/components/velux/light.py index 311a4dba283..e6ca8ea5c2b 100644 --- a/homeassistant/components/velux/light.py +++ b/homeassistant/components/velux/light.py @@ -2,13 +2,8 @@ from __future__ import annotations from pyvlx import Intensity, LighteningDevice -from pyvlx.node import Node -from homeassistant.components.light import ( - ATTR_BRIGHTNESS, - COLOR_MODE_BRIGHTNESS, - LightEntity, -) +from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType @@ -33,12 +28,8 @@ async def async_setup_platform( class VeluxLight(VeluxEntity, LightEntity): """Representation of a Velux light.""" - def __init__(self, node: Node) -> None: - """Initialize the Velux light.""" - super().__init__(node) - - self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS} - self._attr_color_mode = COLOR_MODE_BRIGHTNESS + _attr_supported_color_modes = {ColorMode.BRIGHTNESS} + _attr_color_mode = ColorMode.BRIGHTNESS @property def brightness(self):