mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Use ColorMode enum in axis (#70425)
This commit is contained in:
parent
5ec855e020
commit
fde79e606d
@ -1,11 +1,7 @@
|
|||||||
"""Support for Axis lights."""
|
"""Support for Axis lights."""
|
||||||
from axis.event_stream import CLASS_LIGHT
|
from axis.event_stream import CLASS_LIGHT
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
|
||||||
ATTR_BRIGHTNESS,
|
|
||||||
COLOR_MODE_BRIGHTNESS,
|
|
||||||
LightEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
@ -59,8 +55,8 @@ class AxisLight(AxisEventBase, LightEntity):
|
|||||||
light_type = device.api.vapix.light_control[self.light_id].light_type
|
light_type = device.api.vapix.light_control[self.light_id].light_type
|
||||||
self._attr_name = f"{device.name} {light_type} {event.TYPE} {event.id}"
|
self._attr_name = f"{device.name} {light_type} {event.TYPE} {event.id}"
|
||||||
|
|
||||||
self._attr_supported_color_modes = {COLOR_MODE_BRIGHTNESS}
|
self._attr_supported_color_modes = {ColorMode.BRIGHTNESS}
|
||||||
self._attr_color_mode = COLOR_MODE_BRIGHTNESS
|
self._attr_color_mode = ColorMode.BRIGHTNESS
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Subscribe lights events."""
|
"""Subscribe lights events."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user