Use ColorMode enum in decora_wifi (#70430)
parent
35e395235a
commit
0e1911cd9b
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue