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