Use ColorMode enum in rflink (#70531)
This commit is contained in:
parent
dad806b16b
commit
dcddc910b8
1 changed files with 5 additions and 6 deletions
|
@ -8,9 +8,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_NAME, CONF_TYPE
|
from homeassistant.const import CONF_DEVICES, CONF_NAME, CONF_TYPE
|
||||||
|
@ -174,15 +173,15 @@ async def async_setup_platform(
|
||||||
class RflinkLight(SwitchableRflinkDevice, LightEntity):
|
class RflinkLight(SwitchableRflinkDevice, LightEntity):
|
||||||
"""Representation of a Rflink light."""
|
"""Representation of a Rflink light."""
|
||||||
|
|
||||||
_attr_color_mode = COLOR_MODE_ONOFF
|
_attr_color_mode = ColorMode.ONOFF
|
||||||
_attr_supported_color_modes = {COLOR_MODE_ONOFF}
|
_attr_supported_color_modes = {ColorMode.ONOFF}
|
||||||
|
|
||||||
|
|
||||||
class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity):
|
class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity):
|
||||||
"""Rflink light device that support dimming."""
|
"""Rflink light device that support dimming."""
|
||||||
|
|
||||||
_attr_color_mode = COLOR_MODE_BRIGHTNESS
|
_attr_color_mode = ColorMode.BRIGHTNESS
|
||||||
_attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
_attr_supported_color_modes = {ColorMode.BRIGHTNESS}
|
||||||
_brightness = 255
|
_brightness = 255
|
||||||
|
|
||||||
async def async_added_to_hass(self):
|
async def async_added_to_hass(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue