1 """Support for Lutron Caseta switches."""
10 from .entity
import LutronCasetaUpdatableEntity
15 config_entry: ConfigEntry,
16 async_add_entities: AddEntitiesCallback,
18 """Set up the Lutron Caseta switch platform.
20 Adds switches from the Caseta bridge associated with the config_entry as
23 data = config_entry.runtime_data
25 switch_devices = bridge.get_devices_by_domain(SWITCH_DOMAIN)
32 """Representation of a Lutron Caseta switch."""
35 """Init a button entity."""
40 if "parent_device" not in device:
43 keypads = data.keypad_data.keypads
44 parent_keypad = keypads[device[
"parent_device"]]
45 parent_device_info = parent_keypad[
"device_info"]
53 """Turn the switch on."""
57 """Turn the switch off."""
62 """Return true if device is on."""
None async_turn_on(self, **Any kwargs)
def __init__(self, device, data)
None async_turn_off(self, **Any kwargs)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)