ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
dht12.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::dht12 {
8
10 public:
11 void setup() override;
12 void dump_config() override;
13 void update() override;
14
15 void set_temperature_sensor(sensor::Sensor *temperature_sensor) { temperature_sensor_ = temperature_sensor; }
16 void set_humidity_sensor(sensor::Sensor *humidity_sensor) { humidity_sensor_ = humidity_sensor; }
17
18 protected:
19 bool read_data_(uint8_t *data);
20
23};
24
25} // namespace esphome::dht12
This class simplifies creating components that periodically check a state.
Definition component.h:602
void dump_config() override
Definition dht12.cpp:42
void set_humidity_sensor(sensor::Sensor *humidity_sensor)
Definition dht12.h:16
sensor::Sensor * humidity_sensor_
Definition dht12.h:22
sensor::Sensor * temperature_sensor_
Definition dht12.h:21
void set_temperature_sensor(sensor::Sensor *temperature_sensor)
Definition dht12.h:15
bool read_data_(uint8_t *data)
Definition dht12.cpp:52
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
Base-class for all sensors.
Definition sensor.h:47