mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 06:47:09 +00:00
Use ColorMode enum in crownstone (#70432)
This commit is contained in:
parent
cc3d6aa247
commit
56921a41bf
@ -9,12 +9,7 @@ from crownstone_cloud.const import DIMMING_ABILITY
|
||||
from crownstone_cloud.exceptions import CrownstoneAbilityError
|
||||
from crownstone_uart import CrownstoneUart
|
||||
|
||||
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.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
@ -102,8 +97,8 @@ class CrownstoneEntity(CrownstoneBaseEntity, LightEntity):
|
||||
def color_mode(self) -> str:
|
||||
"""Return the color mode of the light."""
|
||||
if self.device.abilities.get(DIMMING_ABILITY).is_enabled:
|
||||
return COLOR_MODE_BRIGHTNESS
|
||||
return COLOR_MODE_ONOFF
|
||||
return ColorMode.BRIGHTNESS
|
||||
return ColorMode.ONOFF
|
||||
|
||||
@property
|
||||
def supported_color_modes(self) -> set[str] | None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user