ESPHome
2026.5.0b1
Loading...
Searching...
No Matches
esphome
components
scd4x
automation.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/core/automation.h
"
5
#include "
scd4x.h
"
6
7
namespace
esphome::scd4x
{
8
9
template
<
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
21
template
<
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
esphome::Action
Definition
automation.h:508
esphome::Parented
Helper class to easily give an object a parent of type T.
Definition
helpers.h:1861
esphome::Parented< SCD4XComponent >::parent_
SCD4XComponent * parent_
Definition
helpers.h:1872
esphome::scd4x::FactoryResetAction
Definition
automation.h:21
esphome::scd4x::FactoryResetAction::play
void play(const Ts &...x) override
Definition
automation.h:23
esphome::scd4x::PerformForcedCalibrationAction
Definition
automation.h:9
esphome::scd4x::PerformForcedCalibrationAction::play
void play(const Ts &...x) override
Definition
automation.h:11
component.h
automation.h
esphome::scd4x
Definition
automation.h:7
scd4x.h
x
uint16_t x
Definition
tt21100.cpp:5
Generated by
1.12.0