ESPHome 2026.5.1
Loading...
Searching...
No Matches
esphome::light::ToggleAction< HasTransitionLength, Ts > Class Template Reference

#include <automation.h>

Inheritance diagram for esphome::light::ToggleAction< HasTransitionLength, Ts >:
esphome::Action< Ts... >

Data Structures

struct  NoTransition
 

Public Member Functions

 ToggleAction (LightState *state)
 
template<typename V >
requires (HasTransitionLength)
void set_transition_length (V value)
 
void play (const Ts &...x) override
 
- Public Member Functions inherited from esphome::Action< Ts... >
virtual void play_complex (const Ts &...x)
 
virtual void stop_complex ()
 
virtual 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 Attributes

LightStatestate_
 
std::conditional_t< HasTransitionLength, TemplatableFn< uint32_t, Ts... >, NoTransitiontransition_length_ {}
 
- Protected Attributes inherited from esphome::Action< Ts... >
friend ActionList< Ts... >
 
Action< Ts... > * next_
 
int num_running_
 The number of instances of this sequence in the list of actions that is currently being executed.
 

Additional Inherited Members

- Protected Member Functions inherited from esphome::Action< Ts... >
void play_next_ (const Ts &...x)
 
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_ ()
 

Detailed Description

template<bool HasTransitionLength, typename... Ts>
class esphome::light::ToggleAction< HasTransitionLength, Ts >

Definition at line 11 of file automation.h.

Constructor & Destructor Documentation

◆ ToggleAction()

template<bool HasTransitionLength, typename... Ts>
esphome::light::ToggleAction< HasTransitionLength, Ts >::ToggleAction ( LightState * state)
inlineexplicit

Definition at line 13 of file automation.h.

Member Function Documentation

◆ play()

template<bool HasTransitionLength, typename... Ts>
void esphome::light::ToggleAction< HasTransitionLength, Ts >::play ( const Ts &... x)
inlineoverridevirtual

Implements esphome::Action< Ts... >.

Definition at line 19 of file automation.h.

◆ set_transition_length()

template<bool HasTransitionLength, typename... Ts>
template<typename V >
requires (HasTransitionLength)
void esphome::light::ToggleAction< HasTransitionLength, Ts >::set_transition_length ( V value)
inline

Definition at line 15 of file automation.h.

Field Documentation

◆ state_

template<bool HasTransitionLength, typename... Ts>
LightState* esphome::light::ToggleAction< HasTransitionLength, Ts >::state_
protected

Definition at line 28 of file automation.h.

◆ transition_length_

template<bool HasTransitionLength, typename... Ts>
std::conditional_t<HasTransitionLength, TemplatableFn<uint32_t, Ts...>, NoTransition> esphome::light::ToggleAction< HasTransitionLength, Ts >::transition_length_ {}
protected

Definition at line 31 of file automation.h.


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