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