Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.switch.device_trigger Namespace Reference

Functions

CALLBACK_TYPE async_attach_trigger (HomeAssistant hass, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
 
dict[str, vol.Schema] async_get_trigger_capabilities (HomeAssistant hass, ConfigType config)
 
list[dict[str, str]] async_get_triggers (HomeAssistant hass, str device_id)
 

Variables

 TRIGGER_SCHEMA
 

Detailed Description

Provides device triggers for switches.

Function Documentation

◆ async_attach_trigger()

CALLBACK_TYPE homeassistant.components.switch.device_trigger.async_attach_trigger ( HomeAssistant  hass,
ConfigType  config,
TriggerActionType  action,
TriggerInfo  trigger_info 
)
Listen for state changes based on configuration.

Definition at line 21 of file device_trigger.py.

◆ async_get_trigger_capabilities()

dict[str, vol.Schema] homeassistant.components.switch.device_trigger.async_get_trigger_capabilities ( HomeAssistant  hass,
ConfigType   config 
)
List trigger capabilities.

Definition at line 38 of file device_trigger.py.

◆ async_get_triggers()

list[dict[str, str]] homeassistant.components.switch.device_trigger.async_get_triggers ( HomeAssistant  hass,
str   device_id 
)
List device triggers.

Definition at line 31 of file device_trigger.py.

Variable Documentation

◆ TRIGGER_SCHEMA

homeassistant.components.switch.device_trigger.TRIGGER_SCHEMA
Initial value:
1 = vol.All(
2  toggle_entity.TRIGGER_SCHEMA,
3  vol.Schema({vol.Required(CONF_DOMAIN): DOMAIN}, extra=vol.ALLOW_EXTRA),
4 )

Definition at line 15 of file device_trigger.py.