Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.trigger.PluggableAction Class Reference

Public Member Functions

bool __bool__ (self)
 
None __init__ (self, CALLBACK_TYPE|None update=None)
 
CALLBACK_TYPE async_register (self, HomeAssistant hass, dict[str, str] trigger)
 
None async_run (self, HomeAssistant hass, Context|None context=None)
 
None async_run_update (self)
 

Static Public Member Functions

CALLBACK_TYPE async_attach_trigger (HomeAssistant hass, dict[str, str] trigger, TriggerActionType action, dict[str, Any] variables)
 
dict[tuple, PluggableActionsEntryasync_get_registry (HomeAssistant hass)
 

Static Public Attributes

 None
 

Private Attributes

 _entry
 
 _update
 

Detailed Description

A pluggable action handler.

Definition at line 118 of file trigger.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.trigger.PluggableAction.__init__ (   self,
CALLBACK_TYPE | None   update = None 
)
Initialize a pluggable action.

:param update: callback triggered whenever triggers are attached or removed.

Definition at line 123 of file trigger.py.

Member Function Documentation

◆ __bool__()

bool homeassistant.helpers.trigger.PluggableAction.__bool__ (   self)
Return if we have something attached.

Definition at line 130 of file trigger.py.

◆ async_attach_trigger()

CALLBACK_TYPE homeassistant.helpers.trigger.PluggableAction.async_attach_trigger ( HomeAssistant  hass,
dict[str, str]  trigger,
TriggerActionType  action,
dict[str, Any]  variables 
)
static
Attach an action to a trigger entry.

Existing or future plugs registered will be attached.

Definition at line 151 of file trigger.py.

◆ async_get_registry()

dict[tuple, PluggableActionsEntry] homeassistant.helpers.trigger.PluggableAction.async_get_registry ( HomeAssistant  hass)
static
Return the pluggable actions registry.

Definition at line 142 of file trigger.py.

◆ async_register()

CALLBACK_TYPE homeassistant.helpers.trigger.PluggableAction.async_register (   self,
HomeAssistant  hass,
dict[str, str]   trigger 
)
Register plug in the global plugs dictionary.

Definition at line 184 of file trigger.py.

◆ async_run()

None homeassistant.helpers.trigger.PluggableAction.async_run (   self,
HomeAssistant  hass,
Context | None   context = None 
)
Run all actions.

Definition at line 208 of file trigger.py.

◆ async_run_update()

None homeassistant.helpers.trigger.PluggableAction.async_run_update (   self)
Run update function if one exists.

Definition at line 135 of file trigger.py.

Member Data Documentation

◆ _entry

homeassistant.helpers.trigger.PluggableAction._entry
private

Definition at line 191 of file trigger.py.

◆ _update

homeassistant.helpers.trigger.PluggableAction._update
private

Definition at line 128 of file trigger.py.

◆ None

homeassistant.helpers.trigger.PluggableAction.None
static
A pluggable action handler.

Definition at line 121 of file trigger.py.


The documentation for this class was generated from the following file: