ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
pm2005.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::pm2005 {
8
13
14class PM2005Component final : public PollingComponent, public i2c::I2CDevice {
15 public:
16 void set_sensor_type(SensorType sensor_type) { this->sensor_type_ = sensor_type; }
17
18 void setup() override;
19 void dump_config() override;
20 void update() override;
21
22 protected:
24 uint8_t data_buffer_[12];
26
27 SUB_SENSOR(pm_1_0)
28 SUB_SENSOR(pm_2_5)
29 SUB_SENSOR(pm_10_0)
30 protected:
31 uint8_t situation_value_index_{3};
36};
37
38} // namespace esphome::pm2005
This class simplifies creating components that periodically check a state.
Definition component.h:532
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
SUB_SENSOR(pm_1_0) SUB_SENSOR(pm_2_5) SUB_SENSOR(pm_10_0) protected uint8_t pm_1_0_value_index_
Definition pm2005.h:32
void set_sensor_type(SensorType sensor_type)
Definition pm2005.h:16