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

Functions

CALLBACK_TYPE async_attach_trigger (HomeAssistant hass, ConfigType config, TriggerActionType action, TriggerInfo trigger_info)
 
list[dict[str, Any]] async_get_triggers (HomeAssistant hass, str device_id)
 
ConfigType async_validate_trigger_config (HomeAssistant hass, ConfigType config)
 
list[str] get_event_classes_by_device_id (HomeAssistant hass, str device_id)
 
set[str] get_event_types_by_event_class (str event_class)
 

Variables

dictionary EVENT_TYPES_BY_EVENT_CLASS
 
 TRIGGER_SCHEMA
 

Detailed Description

Provides device triggers for BTHome BLE.

Function Documentation

◆ async_attach_trigger()

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

Definition at line 129 of file device_trigger.py.

◆ async_get_triggers()

list[dict[str, Any]] homeassistant.components.bthome.device_trigger.async_get_triggers ( HomeAssistant  hass,
str   device_id 
)
Return a list of triggers for BTHome BLE devices.

Definition at line 109 of file device_trigger.py.

◆ async_validate_trigger_config()

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

Definition at line 86 of file device_trigger.py.

◆ get_event_classes_by_device_id()

list[str] homeassistant.components.bthome.device_trigger.get_event_classes_by_device_id ( HomeAssistant  hass,
str  device_id 
)
Get the supported event classes for a device.

Events for BTHome BLE devices are dynamically discovered
and stored in the device config entry when they are first seen.

Definition at line 54 of file device_trigger.py.

◆ get_event_types_by_event_class()

set[str] homeassistant.components.bthome.device_trigger.get_event_types_by_event_class ( str  event_class)
Get the supported event types for an event class.

If the device has multiple buttons they will have
event classes like button_1 button_2, button_3, etc
but if there is only one button then it will be
button without a number postfix.

Definition at line 75 of file device_trigger.py.

Variable Documentation

◆ EVENT_TYPES_BY_EVENT_CLASS

dictionary homeassistant.components.bthome.device_trigger.EVENT_TYPES_BY_EVENT_CLASS
Initial value:
1 = {
2  EVENT_CLASS_BUTTON: {
3  "press",
4  "double_press",
5  "triple_press",
6  "long_press",
7  "long_double_press",
8  "long_triple_press",
9  },
10  EVENT_CLASS_DIMMER: {"rotate_left", "rotate_right"},
11 }

Definition at line 37 of file device_trigger.py.

◆ TRIGGER_SCHEMA

homeassistant.components.bthome.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 49 of file device_trigger.py.