Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.lock.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
 
dictionary TRIGGER_TYPES
 

Detailed Description

Provides device automations for Lock.

Function Documentation

◆ async_attach_trigger()

CALLBACK_TYPE homeassistant.components.lock.device_trigger.async_attach_trigger ( HomeAssistant  hass,
ConfigType  config,
TriggerActionType  action,
TriggerInfo  trigger_info 
)
Attach a trigger.

Definition at line 81 of file device_trigger.py.

◆ async_get_trigger_capabilities()

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

Definition at line 70 of file device_trigger.py.

◆ async_get_triggers()

list[dict[str, str]] homeassistant.components.lock.device_trigger.async_get_triggers ( HomeAssistant  hass,
str   device_id 
)
List device triggers for Lock devices.

Definition at line 43 of file device_trigger.py.

Variable Documentation

◆ TRIGGER_SCHEMA

homeassistant.components.lock.device_trigger.TRIGGER_SCHEMA
Initial value:
1 = DEVICE_TRIGGER_BASE_SCHEMA.extend(
2  {
3  vol.Required(CONF_ENTITY_ID): cv.entity_id_or_uuid,
4  vol.Required(CONF_TYPE): vol.In(TRIGGER_TYPES),
5  vol.Optional(CONF_FOR): cv.positive_time_period_dict,
6  }
7 )

Definition at line 34 of file device_trigger.py.

◆ TRIGGER_TYPES

dictionary homeassistant.components.lock.device_trigger.TRIGGER_TYPES
Initial value:
1 = {
2  "jammed",
3  "locked",
4  "locking",
5  "open",
6  "opening",
7  "unlocked",
8  "unlocking",
9 }

Definition at line 24 of file device_trigger.py.