mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Use ColorMode enum in ihc (#70508)
This commit is contained in:
parent
34ad7b329e
commit
346a385f1a
@ -3,12 +3,7 @@ from __future__ import annotations
|
||||
|
||||
from ihcsdk.ihccontroller import IHCController
|
||||
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
COLOR_MODE_BRIGHTNESS,
|
||||
COLOR_MODE_ONOFF,
|
||||
LightEntity,
|
||||
)
|
||||
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
@ -80,9 +75,9 @@ class IhcLight(IHCDevice, LightEntity):
|
||||
self._state = False
|
||||
|
||||
if self._dimmable:
|
||||
self._attr_color_mode = COLOR_MODE_BRIGHTNESS
|
||||
self._attr_color_mode = ColorMode.BRIGHTNESS
|
||||
else:
|
||||
self._attr_color_mode = COLOR_MODE_ONOFF
|
||||
self._attr_color_mode = ColorMode.ONOFF
|
||||
self._attr_supported_color_modes = {self._attr_color_mode}
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user