ESPHome  2024.12.2
automation.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 
9 namespace pulse_counter {
10 
11 template<typename... Ts> class SetTotalPulsesAction : public Action<Ts...> {
12  public:
13  SetTotalPulsesAction(PulseCounterSensor *pulse_counter) : pulse_counter_(pulse_counter) {}
14 
15  TEMPLATABLE_VALUE(uint32_t, total_pulses)
16 
17  void play(Ts... x) override { this->pulse_counter_->set_total_pulses(this->total_pulses_.value(x...)); }
18 
19  protected:
21 };
22 
23 } // namespace pulse_counter
24 } // namespace esphome
uint16_t x
Definition: tt21100.cpp:17
TEMPLATABLE_VALUE(uint32_t, total_pulses) void play(Ts... x) override
Definition: automation.h:15
SetTotalPulsesAction(PulseCounterSensor *pulse_counter)
Definition: automation.h:13
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
virtual void play(Ts... x)=0