mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Migrate sleepiq light to ColorMode (#70905)
This commit is contained in:
parent
c530bc823b
commit
abd60832fe
@ -4,7 +4,7 @@ from typing import Any
|
|||||||
|
|
||||||
from asyncsleepiq import SleepIQBed, SleepIQLight
|
from asyncsleepiq import SleepIQBed, SleepIQLight
|
||||||
|
|
||||||
from homeassistant.components.light import LightEntity
|
from homeassistant.components.light import ColorMode, 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.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -34,6 +34,9 @@ async def async_setup_entry(
|
|||||||
class SleepIQLightEntity(SleepIQBedEntity, LightEntity):
|
class SleepIQLightEntity(SleepIQBedEntity, LightEntity):
|
||||||
"""Representation of a light."""
|
"""Representation of a light."""
|
||||||
|
|
||||||
|
_attr_color_mode = ColorMode.ONOFF
|
||||||
|
_attr_supported_color_modes = {ColorMode.ONOFF}
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, coordinator: DataUpdateCoordinator, bed: SleepIQBed, light: SleepIQLight
|
self, coordinator: DataUpdateCoordinator, bed: SleepIQBed, light: SleepIQLight
|
||||||
) -> None:
|
) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user