ESPHome  2024.3.1
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  unsigned read_delay_{};
31  void read_data_();
32  void restart_read_();
33  uint32_t start_time_{};
34 };
35 
36 } // namespace aht10
37 } // 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:162
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:160
void set_variant(AHT10Variant variant)
Definition: aht10.h:20
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
void setup() override
Definition: aht10.cpp:38
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133