ESPHome 2025.5.0
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
5#include "scd4x.h"
6
7namespace esphome {
8namespace scd4x {
9
10template<typename... Ts> class PerformForcedCalibrationAction : public Action<Ts...>, public Parented<SCD4XComponent> {
11 public:
12 void play(Ts... x) override {
13 if (this->value_.has_value()) {
14 this->parent_->perform_forced_calibration(this->value_.value(x...));
15 }
16 }
17
18 protected:
19 TEMPLATABLE_VALUE(uint16_t, value)
20};
21
22template<typename... Ts> class FactoryResetAction : public Action<Ts...>, public Parented<SCD4XComponent> {
23 public:
24 void play(Ts... x) override { this->parent_->factory_reset(); }
25};
26
27} // namespace scd4x
28} // namespace esphome
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
void play(Ts... x) override
Definition automation.h:24
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint16_t x
Definition tt21100.cpp:5