Use ColorMode enum in futurenow (#70498)
This commit is contained in:
parent
562927cc17
commit
33c1501f35
1 changed files with 3 additions and 4 deletions
|
@ -6,9 +6,8 @@ import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
COLOR_MODE_BRIGHTNESS,
|
|
||||||
COLOR_MODE_ONOFF,
|
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
|
ColorMode,
|
||||||
LightEntity,
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import CONF_DEVICES, CONF_HOST, CONF_NAME, CONF_PORT
|
from homeassistant.const import CONF_DEVICES, CONF_HOST, CONF_NAME, CONF_PORT
|
||||||
|
@ -110,8 +109,8 @@ class FutureNowLight(LightEntity):
|
||||||
def color_mode(self) -> str:
|
def color_mode(self) -> str:
|
||||||
"""Return the color mode of the light."""
|
"""Return the color mode of the light."""
|
||||||
if self._dimmable:
|
if self._dimmable:
|
||||||
return COLOR_MODE_BRIGHTNESS
|
return ColorMode.BRIGHTNESS
|
||||||
return COLOR_MODE_ONOFF
|
return ColorMode.ONOFF
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_color_modes(self) -> set[str] | None:
|
def supported_color_modes(self) -> set[str] | None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue