ESPHome  2024.12.2
Public Member Functions | Protected Attributes
esphome::script::ParallelScript< Ts > Class Template Reference

A script type that executes new instances in parallel. More...

#include <script.h>

Inheritance diagram for esphome::script::ParallelScript< Ts >:
esphome::script::Script< Ts... > esphome::script::ScriptLogger esphome::Trigger< Ts... >

Public Member Functions

void execute (Ts... x) override
 
void set_max_runs (int max_runs)
 
- Public Member Functions inherited from esphome::script::Script< Ts... >
virtual bool is_running ()
 Check if any instance of this script is currently running. More...
 
virtual void stop ()
 Stop all instances of this script. More...
 
void execute_tuple (const std::tuple< Ts... > &tuple)
 
void set_name (const std::string &name)
 
- Public Member Functions inherited from esphome::Trigger< Ts... >
void trigger (Ts... x)
 Inform the parent automation that the event has triggered. More...
 
void set_automation_parent (Automation< Ts... > *automation_parent)
 
void stop_action ()
 Stop any action connected to this trigger. More...
 
bool is_action_running ()
 Returns true if any action connected to this trigger is running. More...
 

Protected Attributes

int max_runs_ = 0
 
- Protected Attributes inherited from esphome::script::Script< Ts... >
std::string name_
 
- Protected Attributes inherited from esphome::Trigger< Ts... >
Automation< Ts... > * automation_parent_
 

Additional Inherited Members

- Protected Member Functions inherited from esphome::script::Script< Ts... >
void execute_tuple_ (const std::tuple< Ts... > &tuple, seq< S... >)
 
- Protected Member Functions inherited from esphome::script::ScriptLogger
void esp_logw_ (int line, const char *format, const char *param)
 
void esp_logd_ (int line, const char *format, const char *param)
 
void esp_log_ (int level, int line, const char *format, const char *param)
 

Detailed Description

template<typename... Ts>
class esphome::script::ParallelScript< Ts >

A script type that executes new instances in parallel.

If a new instance is started while previous ones haven't finished yet, the new one is executed in parallel to the other instances.

Definition at line 142 of file script.h.

Member Function Documentation

◆ execute()

template<typename... Ts>
void esphome::script::ParallelScript< Ts >::execute ( Ts...  x)
inlineoverridevirtual

Implements esphome::script::Script< Ts... >.

Definition at line 144 of file script.h.

◆ set_max_runs()

template<typename... Ts>
void esphome::script::ParallelScript< Ts >::set_max_runs ( int  max_runs)
inline

Definition at line 151 of file script.h.

Field Documentation

◆ max_runs_

template<typename... Ts>
int esphome::script::ParallelScript< Ts >::max_runs_ = 0
protected

Definition at line 154 of file script.h.


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