ESPHome  2024.3.2
dht12.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace dht12 {
9 
11  public:
12  void setup() override;
13  void dump_config() override;
14  float get_setup_priority() const override;
15  void update() override;
16 
17  void set_temperature_sensor(sensor::Sensor *temperature_sensor) { temperature_sensor_ = temperature_sensor; }
18  void set_humidity_sensor(sensor::Sensor *humidity_sensor) { humidity_sensor_ = humidity_sensor; }
19 
20  protected:
21  bool read_data_(uint8_t *data);
22 
25 };
26 
27 } // namespace dht12
28 } // namespace esphome
void set_temperature_sensor(sensor::Sensor *temperature_sensor)
Definition: dht12.h:17
sensor::Sensor * humidity_sensor_
Definition: dht12.h:24
bool read_data_(uint8_t *data)
Definition: dht12.cpp:54
This class simplifies creating components that periodically check a state.
Definition: component.h:283
sensor::Sensor * temperature_sensor_
Definition: dht12.h:23
void update() override
Definition: dht12.cpp:13
void setup() override
Definition: dht12.cpp:36
float get_setup_priority() const override
Definition: dht12.cpp:53
void dump_config() override
Definition: dht12.cpp:44
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
void set_humidity_sensor(sensor::Sensor *humidity_sensor)
Definition: dht12.h:18
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