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

Classes

class  TriggerSource
 

Functions

CALLBACK_TYPE async_attach_trigger (HomeAssistant hass, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
 
None async_fire_triggers (HKDevice conn, dict[tuple[int, int], dict[str, Any]] events)
 
TriggerSource async_get_or_create_trigger_source (HomeAssistant hass, str device_id)
 
list[dict[str, str]] async_get_triggers (HomeAssistant hass, str device_id)
 
None async_setup_triggers_for_entry (HomeAssistant hass, ConfigEntry config_entry)
 
list[dict[str, Any]] enumerate_doorbell (Service service)
 
list[dict[str, Any]] enumerate_stateless_switch (Service service)
 
list[dict[str, Any]] enumerate_stateless_switch_group (Service service)
 

Variables

string CONF_IID = "iid"
 
string CONF_SUBTYPE = "subtype"
 
dictionary HK_TO_HA_INPUT_EVENT_VALUES
 
dictionary TRIGGER_FINDERS
 
 TRIGGER_SCHEMA
 
dictionary TRIGGER_SUBTYPES = {"single_press", "double_press", "long_press"}
 
dictionary TRIGGER_TYPES
 

Detailed Description

Provides device automations for homekit devices.

Function Documentation

◆ async_attach_trigger()

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

Definition at line 298 of file device_trigger.py.

◆ async_fire_triggers()

None homeassistant.components.homekit_controller.device_trigger.async_fire_triggers ( HKDevice  conn,
dict[tuple[int, int], dict[str, Any]]   events 
)
Process events generated by a HomeKit accessory into automation triggers.

Definition at line 259 of file device_trigger.py.

◆ async_get_or_create_trigger_source()

TriggerSource homeassistant.components.homekit_controller.device_trigger.async_get_or_create_trigger_source ( HomeAssistant  hass,
str   device_id 
)
Get or create a trigger source for a device id.

Definition at line 248 of file device_trigger.py.

◆ async_get_triggers()

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

Definition at line 276 of file device_trigger.py.

◆ async_setup_triggers_for_entry()

None homeassistant.components.homekit_controller.device_trigger.async_setup_triggers_for_entry ( HomeAssistant  hass,
ConfigEntry   config_entry 
)
Triggers aren't entities as they have no state, but we still need to set them up for a config entry.

Definition at line 209 of file device_trigger.py.

◆ enumerate_doorbell()

list[dict[str, Any]] homeassistant.components.homekit_controller.device_trigger.enumerate_doorbell ( Service  service)
Enumerate doorbell buttons.

Definition at line 183 of file device_trigger.py.

◆ enumerate_stateless_switch()

list[dict[str, Any]] homeassistant.components.homekit_controller.device_trigger.enumerate_stateless_switch ( Service  service)
Enumerate a stateless switch, like a single button.

Definition at line 125 of file device_trigger.py.

◆ enumerate_stateless_switch_group()

list[dict[str, Any]] homeassistant.components.homekit_controller.device_trigger.enumerate_stateless_switch_group ( Service  service)
Enumerate a group of stateless switches, like a remote control.

Definition at line 153 of file device_trigger.py.

Variable Documentation

◆ CONF_IID

string homeassistant.components.homekit_controller.device_trigger.CONF_IID = "iid"

Definition at line 41 of file device_trigger.py.

◆ CONF_SUBTYPE

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

Definition at line 42 of file device_trigger.py.

◆ HK_TO_HA_INPUT_EVENT_VALUES

dictionary homeassistant.components.homekit_controller.device_trigger.HK_TO_HA_INPUT_EVENT_VALUES
Initial value:
1 = {
2  InputEventValues.SINGLE_PRESS: "single_press",
3  InputEventValues.DOUBLE_PRESS: "double_press",
4  InputEventValues.LONG_PRESS: "long_press",
5 }

Definition at line 51 of file device_trigger.py.

◆ TRIGGER_FINDERS

dictionary homeassistant.components.homekit_controller.device_trigger.TRIGGER_FINDERS
Initial value:
1 = {
2  ServicesTypes.SERVICE_LABEL: enumerate_stateless_switch_group,
3  ServicesTypes.STATELESS_PROGRAMMABLE_SWITCH: enumerate_stateless_switch,
4  ServicesTypes.DOORBELL: enumerate_doorbell,
5 }

Definition at line 202 of file device_trigger.py.

◆ TRIGGER_SCHEMA

homeassistant.components.homekit_controller.device_trigger.TRIGGER_SCHEMA
Initial value:
1 = DEVICE_TRIGGER_BASE_SCHEMA.extend(
2  {
3  vol.Required(CONF_TYPE): vol.In(TRIGGER_TYPES),
4  vol.Required(CONF_SUBTYPE): vol.In(TRIGGER_SUBTYPES),
5  }
6 )

Definition at line 44 of file device_trigger.py.

◆ TRIGGER_SUBTYPES

dictionary homeassistant.components.homekit_controller.device_trigger.TRIGGER_SUBTYPES = {"single_press", "double_press", "long_press"}

Definition at line 39 of file device_trigger.py.

◆ TRIGGER_TYPES

dictionary homeassistant.components.homekit_controller.device_trigger.TRIGGER_TYPES
Initial value:
1 = {
2  "doorbell",
3  "button1",
4  "button2",
5  "button3",
6  "button4",
7  "button5",
8  "button6",
9  "button7",
10  "button8",
11  "button9",
12  "button10",
13 }

Definition at line 26 of file device_trigger.py.