ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
htu31d.h
Go to the documentation of this file.
1#pragma once
2
7
8namespace esphome::htu31d {
9
10class HTU31DComponent final : public PollingComponent, public i2c::I2CDevice {
11 SUB_SENSOR(temperature)
12 SUB_SENSOR(humidity)
13
14 public:
15 void setup() override;
16 void update() override;
17 void dump_config() override;
18
19 void set_heater_state(bool desired);
20 bool is_heater_enabled();
21
22 protected:
23 bool reset_();
25};
26} // namespace esphome::htu31d
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:84
This class simplifies creating components that periodically check a state.
Definition component.h:532
uint32_t read_serial_num_()
Reads the serial number from the device and checks the CRC.
Definition htu31d.cpp:154
bool reset_()
Sends a 'reset' request to the HTU31D, followed by a 15ms delay.
Definition htu31d.cpp:140
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:144
static void uint32_t
uint16_t temperature
Definition sun_gtil2.cpp:12