ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::Action< Ts > Class Template Referenceabstract

#include <automation.h>

Public Member Functions

virtual void play_complex (const Ts &...x)
 
void stop_complex ()
 
bool is_running ()
 Check if this or any of the following actions are currently running.
 
int num_running_total ()
 The total number of actions that are currently running in this plus any of the following actions in the chain.
 

Protected Member Functions

virtual void play (const Ts &...x)=0
 For a branch owner (if, while), play() runs when the branch finishes.
 
void play_next_ (const Ts &...x)
 
template<size_t... S>
void play_next_tuple_ (const std::tuple< Ts... > &tuple, std::index_sequence< S... >)
 
void play_next_tuple_ (const std::tuple< Ts... > &tuple)
 
virtual void stop ()
 
void stop_next_ ()
 
bool is_running_next_ ()
 
bool next_is_owner_ () const
 
Action * owner_ () const
 Only valid when next_is_owner_().
 
Action * chain_next_ () const
 

Static Protected Member Functions

static Action * tag_owner (Action *owner)
 

Protected Attributes

friend ActionList< Ts... >
 
Action< Ts... > * next_ {nullptr}
 
int num_running_ {0}
 The number of instances of this sequence in the list of actions that is currently being executed.
 

Static Protected Attributes

static constexpr uintptr_t OWNER_TAG = 1
 

Detailed Description

template<typename... Ts>
class esphome::Action< Ts >

Definition at line 582 of file automation.h.

Member Function Documentation

◆ chain_next_()

template<typename... Ts>
Action * esphome::Action< Ts >::chain_next_ ( ) const
inlineprotected

Definition at line 647 of file automation.h.

◆ is_running()

template<typename... Ts>
bool esphome::Action< Ts >::is_running ( )
inline

Check if this or any of the following actions are currently running.

Definition at line 597 of file automation.h.

◆ is_running_next_()

template<typename... Ts>
bool esphome::Action< Ts >::is_running_next_ ( )
inlineprotected

Definition at line 636 of file automation.h.

◆ next_is_owner_()

template<typename... Ts>
bool esphome::Action< Ts >::next_is_owner_ ( ) const
inlineprotected

Definition at line 644 of file automation.h.

◆ num_running_total()

template<typename... Ts>
int esphome::Action< Ts >::num_running_total ( )
inline

The total number of actions that are currently running in this plus any of the following actions in the chain.

Definition at line 601 of file automation.h.

◆ owner_()

template<typename... Ts>
Action * esphome::Action< Ts >::owner_ ( ) const
inlineprotected

Only valid when next_is_owner_().

Definition at line 646 of file automation.h.

◆ play()

template<typename... Ts>
virtual void esphome::Action< Ts >::play ( const Ts &... x)
protectedpure virtual

For a branch owner (if, while), play() runs when the branch finishes.

Implemented in esphome::api::APIRespondAction< Ts >, esphome::api::APIUnregisterServiceCallAction< Ts >, esphome::api::HomeAssistantServiceCallAction< Ts >, esphome::ApplyAction< Fn, Ts >, esphome::ble_client::BLEClientConnectAction< Ts >, esphome::ble_client::BLEClientDisconnectAction< Ts >, esphome::ble_client::BLEClientNumericComparisonReplyAction< Ts >, esphome::ble_client::BLEClientPasskeyReplyAction< Ts >, esphome::ble_client::BLEClientRemoveBondAction< Ts >, esphome::ble_client::BLEClientWriteAction< Ts >, esphome::deep_sleep::EnterDeepSleepAction< Ts >, esphome::DelayAction< Ts >, esphome::esp32_ble_server::esp32_ble_server_automations::BLECharacteristicNotifyAction< Ts >, esphome::espnow::SendAction< Ts >, esphome::http_request::HttpRequestSendAction< Ts >, esphome::IfAction< HasElse, Ts >, esphome::LambdaAction< Ts >, esphome::light::DimRelativeAction< HasTransitionLength, Ts >, esphome::lvgl::LvglAction< Ts >, esphome::lvgl::ObjUpdateAction< Ts >, esphome::modbus_client::ModbusClientSendAction< Ts >, esphome::modbus_client::ReadBitsAction< Ts >, esphome::modbus_client::ReadRegistersAction< Ts >, esphome::modbus_client::ReadWriteMultipleRegistersAction< Ts >, esphome::modbus_client::WriteMultipleCoilsAction< Ts >, esphome::modbus_client::WriteMultipleRegistersAction< Ts >, esphome::modbus_client::WriteSingleCoilAction< Ts >, esphome::modbus_client::WriteSingleRegisterAction< Ts >, esphome::mqtt::MQTTPublishJsonAction< Ts >, esphome::remote_base::RemoteTransmitterActionBase< Ts >, esphome::remote_base::RemoteTransmitterActionBase< Ts... >, esphome::RepeatAction< Ts >, esphome::RepeatAction< Ts... >, esphome::script::ScriptExecuteAction< Script< As... >, Ts... >, esphome::script::ScriptWaitAction< C, Ts >, esphome::speaker::PlayAction< Ts >, esphome::sprinkler::ResumeOrStartAction< Ts >, esphome::sprinkler::ResumeOrStartAction<>, esphome::sprinkler::ShutdownAction< Ts >, esphome::sprinkler::ShutdownAction<>, esphome::StatelessLambdaAction< Ts >, esphome::SuspendComponentAction< Ts >, esphome::UpdateComponentAction< Ts >, esphome::WaitUntilAction< Ts >, and esphome::WhileAction< Ts >.

◆ play_complex()

◆ play_next_()

template<typename... Ts>
void esphome::Action< Ts >::play_next_ ( const Ts &... x)
inlineprotected

Definition at line 613 of file automation.h.

◆ play_next_tuple_() [1/2]

template<typename... Ts>
void esphome::Action< Ts >::play_next_tuple_ ( const std::tuple< Ts... > & tuple)
inlineprotected

Definition at line 626 of file automation.h.

◆ play_next_tuple_() [2/2]

template<typename... Ts>
template<size_t... S>
void esphome::Action< Ts >::play_next_tuple_ ( const std::tuple< Ts... > & tuple,
std::index_sequence< S... >  )
inlineprotected

Definition at line 623 of file automation.h.

◆ stop()

◆ stop_complex()

template<typename... Ts>
void esphome::Action< Ts >::stop_complex ( )
inline

Definition at line 589 of file automation.h.

◆ stop_next_()

template<typename... Ts>
void esphome::Action< Ts >::stop_next_ ( )
inlineprotected

Definition at line 631 of file automation.h.

◆ tag_owner()

template<typename... Ts>
static Action * esphome::Action< Ts >::tag_owner ( Action< Ts > * owner)
inlinestaticprotected

Definition at line 648 of file automation.h.

Field Documentation

◆ ActionList< Ts... >

template<typename... Ts>
friend esphome::Action< Ts >::ActionList< Ts... >
protected

Definition at line 609 of file automation.h.

◆ next_

template<typename... Ts>
Action<Ts...>* esphome::Action< Ts >::next_ {nullptr}
protected

Definition at line 652 of file automation.h.

◆ num_running_

template<typename... Ts>
int esphome::Action< Ts >::num_running_ {0}
protected

The number of instances of this sequence in the list of actions that is currently being executed.

Definition at line 656 of file automation.h.

◆ OWNER_TAG

template<typename... Ts>
uintptr_t esphome::Action< Ts >::OWNER_TAG = 1
staticconstexprprotected

Definition at line 643 of file automation.h.


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