1 """Support for LightwaveRF lights."""
3 from __future__
import annotations
13 from .
import LIGHTWAVE_LINK
21 async_add_entities: AddEntitiesCallback,
22 discovery_info: DiscoveryInfoType |
None =
None,
24 """Find and return LightWave lights."""
25 if not discovery_info:
29 lwlink = hass.data[LIGHTWAVE_LINK]
31 for device_id, device_config
in discovery_info.items():
32 name = device_config[CONF_NAME]
33 lights.append(
LWRFLight(name, device_id, lwlink))
39 """Representation of a LightWaveRF light."""
41 _attr_color_mode = ColorMode.BRIGHTNESS
42 _attr_supported_color_modes = {ColorMode.BRIGHTNESS}
43 _attr_should_poll =
False
46 """Initialize LWRFLight entity."""
53 """Turn the LightWave light on."""
56 if ATTR_BRIGHTNESS
in kwargs:
60 self.
_lwlink_lwlink.turn_on_with_brightness(
69 """Turn the LightWave light off."""
None async_turn_off(self, **Any kwargs)
def __init__(self, name, device_id, lwlink)
None async_turn_on(self, **Any kwargs)
None async_write_ha_state(self)
None turn_off(self, **Any kwargs)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)