mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Migrate ring light to ColorMode (#70903)
This commit is contained in:
parent
ea104feab7
commit
f7e05c5e1c
@ -4,7 +4,7 @@ import logging
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
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
|
||||||
@ -47,6 +47,9 @@ async def async_setup_entry(
|
|||||||
class RingLight(RingEntityMixin, LightEntity):
|
class RingLight(RingEntityMixin, LightEntity):
|
||||||
"""Creates a switch to turn the ring cameras light on and off."""
|
"""Creates a switch to turn the ring cameras light on and off."""
|
||||||
|
|
||||||
|
_attr_color_mode = ColorMode.ONOFF
|
||||||
|
_attr_supported_color_modes = {ColorMode.ONOFF}
|
||||||
|
|
||||||
def __init__(self, config_entry_id, device):
|
def __init__(self, config_entry_id, device):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
super().__init__(config_entry_id, device)
|
super().__init__(config_entry_id, device)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user