ESPHome  2024.11.0
aht10.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <utility>
4 
8 
9 namespace esphome {
10 namespace aht10 {
11 
13 
15  public:
16  void setup() override;
17  void update() override;
18  void dump_config() override;
19  float get_setup_priority() const override;
20  void set_variant(AHT10Variant variant) { this->variant_ = variant; }
21 
22  void set_temperature_sensor(sensor::Sensor *temperature_sensor) { temperature_sensor_ = temperature_sensor; }
23  void set_humidity_sensor(sensor::Sensor *humidity_sensor) { humidity_sensor_ = humidity_sensor; }
24 
25  protected:
29  unsigned read_count_{};
30  void read_data_();
31  void restart_read_();
32  uint32_t start_time_{};
33 };
34 
35 } // namespace aht10
36 } // namespace esphome
void set_temperature_sensor(sensor::Sensor *temperature_sensor)
Definition: aht10.h:22
sensor::Sensor * humidity_sensor_
Definition: aht10.h:27
This class simplifies creating components that periodically check a state.
Definition: component.h:283
void update() override
Definition: aht10.cpp:148
void dump_config() override
Definition: aht10.cpp:161
sensor::Sensor * temperature_sensor_
Definition: aht10.h:26
void set_humidity_sensor(sensor::Sensor *humidity_sensor)
Definition: aht10.h:23
float get_setup_priority() const override
Definition: aht10.cpp:159
void set_variant(AHT10Variant variant)
Definition: aht10.h:20
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
void setup() override
Definition: aht10.cpp:37
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133