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

Functions

tuple[str, dict] _get_device_trigger_data (HomeAssistant hass, str device_id)
 
CALLBACK_TYPE async_attach_trigger (HomeAssistant hass, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
 
list[dict[str, str]] async_get_triggers (HomeAssistant hass, str device_id)
 
ConfigType async_validate_trigger_config (HomeAssistant hass, ConfigType config)
 

Variables

string CONF_SUBTYPE = "subtype"
 
string DEVICE = "device"
 
string DEVICE_IEEE = "device_ieee"
 
 TRIGGER_SCHEMA
 

Detailed Description

Provides device automations for ZHA devices that emit events.

Function Documentation

◆ _get_device_trigger_data()

tuple[str, dict] homeassistant.components.zha.device_trigger._get_device_trigger_data ( HomeAssistant  hass,
str  device_id 
)
private
Get device trigger data for a device, falling back to the cache if possible.

Definition at line 29 of file device_trigger.py.

◆ async_attach_trigger()

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

Definition at line 60 of file device_trigger.py.

◆ async_get_triggers()

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

Make sure the device supports device automations and return the trigger list.

Definition at line 92 of file device_trigger.py.

◆ async_validate_trigger_config()

ConfigType homeassistant.components.zha.device_trigger.async_validate_trigger_config ( HomeAssistant  hass,
ConfigType   config 
)
Validate config.

Definition at line 44 of file device_trigger.py.

Variable Documentation

◆ CONF_SUBTYPE

string homeassistant.components.zha.device_trigger.CONF_SUBTYPE = "subtype"

Definition at line 20 of file device_trigger.py.

◆ DEVICE

string homeassistant.components.zha.device_trigger.DEVICE = "device"

Definition at line 21 of file device_trigger.py.

◆ DEVICE_IEEE

string homeassistant.components.zha.device_trigger.DEVICE_IEEE = "device_ieee"

Definition at line 22 of file device_trigger.py.

◆ TRIGGER_SCHEMA

homeassistant.components.zha.device_trigger.TRIGGER_SCHEMA
Initial value:
1 = DEVICE_TRIGGER_BASE_SCHEMA.extend(
2  {vol.Required(CONF_TYPE): str, vol.Required(CONF_SUBTYPE): str}
3 )

Definition at line 24 of file device_trigger.py.