mirror of
https://github.com/home-assistant/core.git
synced 2025-08-12 17:15:19 +02:00
Migrate sleepiq light to ColorMode (#70905)
This commit is contained in:
@@ -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:
|
||||||
|
Reference in New Issue
Block a user