ESPHome 2026.8.0-dev
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>
10class PerformForcedCalibrationAction final : public Action<Ts...>, public Parented<SCD4XComponent> {
11 public:
12 void play(const 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 final : public Action<Ts...>, public Parented<SCD4XComponent> {
23 public:
24 void play(const Ts &...x) override { this->parent_->factory_reset(); }
25};
26
27} // namespace esphome::scd4x
Helper class to easily give an object a parent of type T.
Definition helpers.h:1881
void play(const Ts &...x) override
Definition automation.h:24
void play(const Ts &...x) override
Definition automation.h:12
uint16_t x
Definition tt21100.cpp:5