Migrate sleepiq light to ColorMode (#70905)

This commit is contained in:
epenet 2022-04-27 15:40:35 +02:00 committed by GitHub
parent c530bc823b
commit abd60832fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ from typing import Any
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.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -34,6 +34,9 @@ async def async_setup_entry(
class SleepIQLightEntity(SleepIQBedEntity, LightEntity):
"""Representation of a light."""
_attr_color_mode = ColorMode.ONOFF
_attr_supported_color_modes = {ColorMode.ONOFF}
def __init__(
self, coordinator: DataUpdateCoordinator, bed: SleepIQBed, light: SleepIQLight
) -> None: