ESPHome  2024.11.1
iaqcore.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace iaqcore {
9 
10 class IAQCore : public PollingComponent, public i2c::I2CDevice {
11  public:
12  void set_co2(sensor::Sensor *co2) { co2_ = co2; }
13  void set_tvoc(sensor::Sensor *tvoc) { tvoc_ = tvoc; }
14 
15  void setup() override;
16  void update() override;
17  void dump_config() override;
18 
19  float get_setup_priority() const override { return setup_priority::DATA; }
20 
21  protected:
22  sensor::Sensor *co2_{nullptr};
23  sensor::Sensor *tvoc_{nullptr};
24 
25  void publish_nans_();
26 };
27 
28 } // namespace iaqcore
29 } // namespace esphome
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
This class simplifies creating components that periodically check a state.
Definition: component.h:283
float get_setup_priority() const override
Definition: iaqcore.h:19
void set_tvoc(sensor::Sensor *tvoc)
Definition: iaqcore.h:13
sensor::Sensor * tvoc_
Definition: iaqcore.h:23
void setup() override
Definition: iaqcore.cpp:27
void dump_config() override
Definition: iaqcore.cpp:87
sensor::Sensor * co2_
Definition: iaqcore.h:22
void update() override
Definition: iaqcore.cpp:35
void set_co2(sensor::Sensor *co2)
Definition: iaqcore.h:12
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133