From 0e1911cd9b0eb723e5e63f5c6840cfcaf433d700 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sat, 23 Apr 2022 07:49:22 +0200 Subject: [PATCH] Use ColorMode enum in decora_wifi (#70430) --- homeassistant/components/decora_wifi/light.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/decora_wifi/light.py b/homeassistant/components/decora_wifi/light.py index 922a4937ea3..7d3b1e353e2 100644 --- a/homeassistant/components/decora_wifi/light.py +++ b/homeassistant/components/decora_wifi/light.py @@ -14,9 +14,8 @@ from homeassistant.components import persistent_notification from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_TRANSITION, - COLOR_MODE_BRIGHTNESS, - COLOR_MODE_ONOFF, PLATFORM_SCHEMA, + ColorMode, LightEntity, LightEntityFeature, ) @@ -103,8 +102,8 @@ class DecoraWifiLight(LightEntity): def color_mode(self) -> str: """Return the color mode of the light.""" if self._switch.canSetLevel: - return COLOR_MODE_BRIGHTNESS - return COLOR_MODE_ONOFF + return ColorMode.BRIGHTNESS + return ColorMode.ONOFF @property def supported_color_modes(self) -> set[str] | None: