mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Use ColorMode enum in control4 (#70428)
This commit is contained in:
parent
bd2639af65
commit
7ffe399a08
@ -11,8 +11,7 @@ from pyControl4.light import C4Light
|
|||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
ATTR_BRIGHTNESS,
|
ATTR_BRIGHTNESS,
|
||||||
ATTR_TRANSITION,
|
ATTR_TRANSITION,
|
||||||
COLOR_MODE_BRIGHTNESS,
|
ColorMode,
|
||||||
COLOR_MODE_ONOFF,
|
|
||||||
LightEntity,
|
LightEntity,
|
||||||
LightEntityFeature,
|
LightEntityFeature,
|
||||||
)
|
)
|
||||||
@ -166,11 +165,11 @@ class Control4Light(Control4Entity, LightEntity):
|
|||||||
)
|
)
|
||||||
self._is_dimmer = is_dimmer
|
self._is_dimmer = is_dimmer
|
||||||
if is_dimmer:
|
if is_dimmer:
|
||||||
self._attr_color_mode = COLOR_MODE_BRIGHTNESS
|
self._attr_color_mode = ColorMode.BRIGHTNESS
|
||||||
self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
self._attr_supported_color_modes = {ColorMode.BRIGHTNESS}
|
||||||
else:
|
else:
|
||||||
self._attr_color_mode = COLOR_MODE_ONOFF
|
self._attr_color_mode = ColorMode.ONOFF
|
||||||
self._attr_supported_color_modes = {COLOR_MODE_ONOFF}
|
self._attr_supported_color_modes = {ColorMode.ONOFF}
|
||||||
|
|
||||||
def create_api_object(self):
|
def create_api_object(self):
|
||||||
"""Create a pyControl4 device object.
|
"""Create a pyControl4 device object.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user