Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.automation.AutomationEntity Class Reference
Inheritance diagram for homeassistant.components.automation.AutomationEntity:
[legend]
Collaboration diagram for homeassistant.components.automation.AutomationEntity:
[legend]

Public Member Functions

None __init__ (self, str|None automation_id, str name, list[ConfigType] trigger_config, IfAction|None cond_func, Script action_script, bool|None initial_state, ScriptVariables|None variables, ScriptVariables|None trigger_variables, ConfigType|None raw_config, ConfigType|None blueprint_inputs, ConfigType trace_config)
 
None async_added_to_hass (self)
 
ScriptRunResult|None async_trigger (self, dict[str, Any] run_variables, Context|None context=None, bool skip_condition=False)
 
None async_turn_off (self, **Any kwargs)
 
None async_turn_on (self, **Any kwargs)
 
None async_will_remove_from_hass (self)
 
dict[str, Any] extra_state_attributes (self)
 
bool is_on (self)
 
set[strreferenced_areas (self)
 
str|None referenced_blueprint (self)
 
set[strreferenced_devices (self)
 
set[strreferenced_entities (self)
 
set[strreferenced_floors (self)
 
set[strreferenced_labels (self)
 
- Public Member Functions inherited from homeassistant.components.automation.BaseAutomationEntity
dict[str, Any]|None capability_attributes (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.ToggleEntity
None async_toggle (self, **Any kwargs)
 
Literal["on", "off"]|None state (self)
 
None toggle (self, **Any kwargs)
 
None turn_off (self, **Any kwargs)
 
None turn_on (self, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
bool assumed_state (self)
 
None async_device_update (self, bool warning=True)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
None async_registry_entry_updated (self)
 
None async_remove (self, *bool force_remove=False)
 
None async_removed_from_registry (self)
 
None async_schedule_update_ha_state (self, bool force_refresh=False)
 
None async_set_context (self, Context context)
 
None async_update_ha_state (self, bool force_refresh=False)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
str|None device_class (self)
 
DeviceInfo|None device_info (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
str|None entity_picture (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (self)
 
bool force_update (self)
 
HassJobType get_hassjob_type (self, str function_name)
 
er.EntityOptionsType|None get_initial_entity_options (self)
 
bool has_entity_name (self)
 
str|None icon (self)
 
str|UndefinedType|None name (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
dict[str, Any]|None state_attributes (self)
 
str|None suggested_object_id (self)
 
int|None supported_features (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unique_id (self)
 
str|None unit_of_measurement (self)
 
bool use_device_name (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.CachedProperties
None __init__ (cls, str name, tuple[type,...] bases, dict[Any, Any] namespace, **Any kwargs)
 
Any __new__ (mcs, str name, tuple[type,...] bases, dict[Any, Any] namespace, set[str]|None cached_properties=None, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.helpers.restore_state.RestoreEntity
ExtraStoredData|None async_get_last_extra_data (self)
 
State|None async_get_last_state (self)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
ExtraStoredData|None extra_restore_state_data (self)
 

Public Attributes

 action_script
 
 raw_config
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Private Member Functions

Callable[[], None]|None _async_attach_triggers (self, bool home_assistant_start)
 
None _async_disable (self, bool stop_actions=DEFAULT_STOP_ACTIONS)
 
None _async_enable (self)
 
None _async_enable_automation (self, Event event)
 
ScriptRunResult|None _async_trigger_if_enabled (self, dict[str, Any] run_variables, Context|None context=None, bool skip_condition=False)
 
None _log_callback (self, int level, str msg, **Any kwargs)
 

Private Attributes

 _async_detach_triggers
 
 _attr_name
 
 _attr_unique_id
 
 _blueprint_inputs
 
 _cond_func
 
 _initial_state
 
 _is_enabled
 
 _logger
 
 _trace_config
 
 _trigger_config
 
 _trigger_variables
 
 _variables
 

Static Private Attributes

bool _attr_should_poll = False
 

Additional Inherited Members

- Static Public Attributes inherited from homeassistant.helpers.entity.ToggleEntity
 None
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Detailed Description

Entity to show status of entity.

Definition at line 494 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.automation.AutomationEntity.__init__ (   self,
str | None  automation_id,
str  name,
list[ConfigType]  trigger_config,
IfAction | None  cond_func,
Script  action_script,
bool | None  initial_state,
ScriptVariables | None  variables,
ScriptVariables | None  trigger_variables,
ConfigType | None  raw_config,
ConfigType | None  blueprint_inputs,
ConfigType  trace_config 
)
Initialize an automation entity.

Definition at line 499 of file __init__.py.

Member Function Documentation

◆ _async_attach_triggers()

Callable[[], None] | None homeassistant.components.automation.AutomationEntity._async_attach_triggers (   self,
bool   home_assistant_start 
)
private
Set up the triggers.

Definition at line 848 of file __init__.py.

◆ _async_disable()

None homeassistant.components.automation.AutomationEntity._async_disable (   self,
bool   stop_actions = DEFAULT_STOP_ACTIONS 
)
private
Disable the automation entity.

This method is not expected to write state to the
state machine.

Definition at line 810 of file __init__.py.

◆ _async_enable()

None homeassistant.components.automation.AutomationEntity._async_enable (   self)
private
Enable this automation entity.

This method is not expected to write state to the
state machine.

Definition at line 790 of file __init__.py.

◆ _async_enable_automation()

None homeassistant.components.automation.AutomationEntity._async_enable_automation (   self,
Event  event 
)
private
Start automation on startup.

Definition at line 781 of file __init__.py.

◆ _async_trigger_if_enabled()

ScriptRunResult | None homeassistant.components.automation.AutomationEntity._async_trigger_if_enabled (   self,
dict[str, Any]  run_variables,
Context | None   context = None,
bool   skip_condition = False 
)
private
Trigger automation if enabled.

If the trigger starts but has a delay, the automation will be triggered
when the delay has passed so we need to make sure its still enabled before
executing the action.

Definition at line 832 of file __init__.py.

◆ _log_callback()

None homeassistant.components.automation.AutomationEntity._log_callback (   self,
int  level,
str  msg,
**Any  kwargs 
)
private
Log helper callback.

Definition at line 828 of file __init__.py.

◆ async_added_to_hass()

None homeassistant.components.automation.AutomationEntity.async_added_to_hass (   self)
Startup with initial state or previous state.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 598 of file __init__.py.

◆ async_trigger()

ScriptRunResult | None homeassistant.components.automation.AutomationEntity.async_trigger (   self,
dict[str, Any]  run_variables,
Context | None   context = None,
bool   skip_condition = False 
)
Trigger automation.

This method is a coroutine.

Reimplemented from homeassistant.components.automation.BaseAutomationEntity.

Definition at line 650 of file __init__.py.

◆ async_turn_off()

None homeassistant.components.automation.AutomationEntity.async_turn_off (   self,
**Any  kwargs 
)
Turn the entity off.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 642 of file __init__.py.

◆ async_turn_on()

None homeassistant.components.automation.AutomationEntity.async_turn_on (   self,
**Any  kwargs 
)
Turn the entity on and update the state.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 637 of file __init__.py.

◆ async_will_remove_from_hass()

None homeassistant.components.automation.AutomationEntity.async_will_remove_from_hass (   self)
Remove listeners when removing automation from Home Assistant.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 776 of file __init__.py.

◆ extra_state_attributes()

dict[str, Any] homeassistant.components.automation.AutomationEntity.extra_state_attributes (   self)
Return the entity state attributes.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 531 of file __init__.py.

◆ is_on()

bool homeassistant.components.automation.AutomationEntity.is_on (   self)
Return True if entity is on.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 543 of file __init__.py.

◆ referenced_areas()

set[str] homeassistant.components.automation.AutomationEntity.referenced_areas (   self)
Return a set of referenced areas.

Reimplemented from homeassistant.components.automation.BaseAutomationEntity.

Definition at line 558 of file __init__.py.

◆ referenced_blueprint()

str | None homeassistant.components.automation.AutomationEntity.referenced_blueprint (   self)
Return referenced blueprint or None.

Reimplemented from homeassistant.components.automation.BaseAutomationEntity.

Definition at line 563 of file __init__.py.

◆ referenced_devices()

set[str] homeassistant.components.automation.AutomationEntity.referenced_devices (   self)
Return a set of referenced devices.

Reimplemented from homeassistant.components.automation.BaseAutomationEntity.

Definition at line 570 of file __init__.py.

◆ referenced_entities()

set[str] homeassistant.components.automation.AutomationEntity.referenced_entities (   self)
Return a set of referenced entities.

Reimplemented from homeassistant.components.automation.BaseAutomationEntity.

Definition at line 584 of file __init__.py.

◆ referenced_floors()

set[str] homeassistant.components.automation.AutomationEntity.referenced_floors (   self)
Return a set of referenced floors.

Reimplemented from homeassistant.components.automation.BaseAutomationEntity.

Definition at line 553 of file __init__.py.

◆ referenced_labels()

set[str] homeassistant.components.automation.AutomationEntity.referenced_labels (   self)
Return a set of referenced labels.

Reimplemented from homeassistant.components.automation.BaseAutomationEntity.

Definition at line 548 of file __init__.py.

Member Data Documentation

◆ _async_detach_triggers

homeassistant.components.automation.AutomationEntity._async_detach_triggers
private

Definition at line 787 of file __init__.py.

◆ _attr_name

homeassistant.components.automation.AutomationEntity._attr_name
private

Definition at line 514 of file __init__.py.

◆ _attr_should_poll

bool homeassistant.components.automation.AutomationEntity._attr_should_poll = False
staticprivate
Entity to show status of entity.

Definition at line 497 of file __init__.py.

◆ _attr_unique_id

homeassistant.components.automation.AutomationEntity._attr_unique_id
private

Definition at line 528 of file __init__.py.

◆ _blueprint_inputs

homeassistant.components.automation.AutomationEntity._blueprint_inputs
private

Definition at line 526 of file __init__.py.

◆ _cond_func

homeassistant.components.automation.AutomationEntity._cond_func
private

Definition at line 517 of file __init__.py.

◆ _initial_state

homeassistant.components.automation.AutomationEntity._initial_state
private

Definition at line 520 of file __init__.py.

◆ _is_enabled

homeassistant.components.automation.AutomationEntity._is_enabled
private

Definition at line 521 of file __init__.py.

◆ _logger

homeassistant.components.automation.AutomationEntity._logger
private

Definition at line 522 of file __init__.py.

◆ _trace_config

homeassistant.components.automation.AutomationEntity._trace_config
private

Definition at line 527 of file __init__.py.

◆ _trigger_config

homeassistant.components.automation.AutomationEntity._trigger_config
private

Definition at line 515 of file __init__.py.

◆ _trigger_variables

homeassistant.components.automation.AutomationEntity._trigger_variables
private

Definition at line 524 of file __init__.py.

◆ _variables

homeassistant.components.automation.AutomationEntity._variables
private

Definition at line 523 of file __init__.py.

◆ action_script

homeassistant.components.automation.AutomationEntity.action_script

Definition at line 518 of file __init__.py.

◆ raw_config

homeassistant.components.automation.AutomationEntity.raw_config

Definition at line 525 of file __init__.py.


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