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

Functions

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)
 

Variables

 TRIGGER_SCHEMA
 
dictionary TRIGGER_TYPES = {"pressed"}
 

Detailed Description

Provides device triggers for Button.

Function Documentation

◆ async_attach_trigger()

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

Definition at line 54 of file device_trigger.py.

◆ async_get_triggers()

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

Definition at line 36 of file device_trigger.py.

Variable Documentation

◆ TRIGGER_SCHEMA

homeassistant.components.button.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  }
6 )

Definition at line 28 of file device_trigger.py.

◆ TRIGGER_TYPES

dictionary homeassistant.components.button.device_trigger.TRIGGER_TYPES = {"pressed"}

Definition at line 26 of file device_trigger.py.