ESPHome 2025.6.2
Loading...
Searching...
No Matches
cm1106.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace esphome {
9namespace cm1106 {
10
12 public:
13 float get_setup_priority() const override { return esphome::setup_priority::DATA; }
14
15 void setup() override;
16 void update() override;
17 void dump_config() override;
18
19 void calibrate_zero(uint16_t ppm);
20
21 void set_co2_sensor(sensor::Sensor *co2_sensor) { this->co2_sensor_ = co2_sensor; }
22
23 protected:
25
26 bool cm1106_write_command_(const uint8_t *command, size_t command_len, uint8_t *response, size_t response_len);
27};
28
29template<typename... Ts> class CM1106CalibrateZeroAction : public Action<Ts...> {
30 public:
32
33 void play(Ts... x) override { this->cm1106_->calibrate_zero(400); }
34
35 protected:
37};
38
39} // namespace cm1106
40} // namespace esphome
This class simplifies creating components that periodically check a state.
Definition component.h:331
CM1106CalibrateZeroAction(CM1106Component *cm1106)
Definition cm1106.h:31
void calibrate_zero(uint16_t ppm)
Definition cm1106.cpp:62
float get_setup_priority() const override
Definition cm1106.h:13
bool cm1106_write_command_(const uint8_t *command, size_t command_len, uint8_t *response, size_t response_len)
Definition cm1106.cpp:87
void set_co2_sensor(sensor::Sensor *co2_sensor)
Definition cm1106.h:21
sensor::Sensor * co2_sensor_
Definition cm1106.h:24
Base-class for all sensors.
Definition sensor.h:62
const float DATA
For components that import data from directly connected sensors like DHT.
Definition component.cpp:20
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint16_t x
Definition tt21100.cpp:5