Use ColorMode enum in decora_wifi (#70430)

pull/58968/head
epenet 2022-04-23 07:49:22 +02:00 committed by GitHub
parent 35e395235a
commit 0e1911cd9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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: