ESPHome 2025.10.0-dev
Loading...
Searching...
No Matches
esphome::script::Script< Ts > Class Template Referenceabstract

The abstract base class for all script types. More...

#include <script.h>

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

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

const LogString * name_ {nullptr}
 
- Protected Attributes inherited from esphome::Trigger< Ts... >
Automation< Ts... > * automation_parent_
 

Detailed Description

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

The abstract base class for all script types.

Definition at line 33 of file script.h.

Member Function Documentation

◆ execute()

template<typename... Ts>
virtual void esphome::script::Script< Ts >::execute ( Ts... )
pure virtual

Execute a new instance of this script.

The behavior of this function when a script is already running is defined by the subtypes

Implemented in esphome::script::ParallelScript< Ts >, esphome::script::QueueingScript< Ts >, esphome::script::RestartScript< Ts >, and esphome::script::SingleScript< Ts >.

◆ execute_tuple()

template<typename... Ts>
void esphome::script::Script< Ts >::execute_tuple ( const std::tuple< Ts... > & tuple)
inline

Definition at line 46 of file script.h.

◆ execute_tuple_()

template<typename... Ts>
template<int... S>
void esphome::script::Script< Ts >::execute_tuple_ ( const std::tuple< Ts... > & tuple,
seq< S... >  )
inlineprotected

Definition at line 54 of file script.h.

◆ is_running()

template<typename... Ts>
virtual bool esphome::script::Script< Ts >::is_running ( )
inlinevirtual

Check if any instance of this script is currently running.

Definition at line 41 of file script.h.

◆ set_name()

template<typename... Ts>
void esphome::script::Script< Ts >::set_name ( const LogString * name)
inline

Definition at line 51 of file script.h.

◆ stop()

template<typename... Ts>
virtual void esphome::script::Script< Ts >::stop ( )
inlinevirtual

Stop all instances of this script.

Reimplemented in esphome::script::QueueingScript< Ts >.

Definition at line 43 of file script.h.

Field Documentation

◆ name_

template<typename... Ts>
const LogString* esphome::script::Script< Ts >::name_ {nullptr}
protected

Definition at line 58 of file script.h.


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