Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.device_automation.entity Namespace Reference

Functions

list[dict[str, str]] _async_get_automations (HomeAssistant hass, str device_id, list[dict[str, str]] automation_templates, str domain)
 
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, str domain)
 

Variables

list ENTITY_TRIGGERS
 
 TRIGGER_SCHEMA
 

Detailed Description

Device automation helpers for entity.

Function Documentation

◆ _async_get_automations()

list[dict[str, str]] homeassistant.components.device_automation.entity._async_get_automations ( HomeAssistant  hass,
str  device_id,
list[dict[str, str]]  automation_templates,
str  domain 
)
private
List device automations.

Definition at line 56 of file entity.py.

◆ async_attach_trigger()

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

Definition at line 34 of file entity.py.

◆ async_get_trigger_capabilities()

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

Definition at line 93 of file entity.py.

◆ async_get_triggers()

list[dict[str, str]] homeassistant.components.device_automation.entity.async_get_triggers ( HomeAssistant  hass,
str  device_id,
str   domain 
)
List device triggers.

Definition at line 86 of file entity.py.

Variable Documentation

◆ ENTITY_TRIGGERS

list homeassistant.components.device_automation.entity.ENTITY_TRIGGERS
Initial value:
1 = [
2  {
3  # Trigger when entity is turned on or off
4  CONF_PLATFORM: "device",
5  CONF_TYPE: CONF_CHANGED_STATES,
6  },
7 ]

Definition at line 17 of file entity.py.

◆ TRIGGER_SCHEMA

homeassistant.components.device_automation.entity.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([CONF_CHANGED_STATES]),
5  vol.Optional(CONF_FOR): cv.positive_time_period_dict,
6  }
7 )

Definition at line 25 of file entity.py.