ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
sht4x.h
Go to the documentation of this file.
1#pragma once
2
6#ifdef USE_TEXT_SENSOR
8#endif
9
10#include <cinttypes>
11
12namespace esphome::sht4x {
13
15
17
19
21 SUB_SENSOR(temp)
22 SUB_SENSOR(humidity)
23#ifdef USE_TEXT_SENSOR
24 SUB_TEXT_SENSOR(serial_number)
25#endif
26
27 public:
28 void setup() override;
29 void dump_config() override;
30 void update() override;
31
32 void set_precision_value(SHT4XPRECISION precision) { this->precision_ = precision; };
33 void set_heater_power_value(SHT4XHEATERPOWER heater_power) { this->heater_power_ = heater_power; };
34 void set_heater_time_value(SHT4XHEATERTIME heater_time) { this->heater_time_ = heater_time; };
35 void set_heater_duty_value(float duty_cycle) { this->duty_cycle_ = duty_cycle; };
36
37 protected:
42
48};
49
50} // namespace esphome::sht4x
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
SHT4XPRECISION precision_
Definition sht4x.h:38
SHT4XHEATERPOWER heater_power_
Definition sht4x.h:39
SHT4XHEATERTIME heater_time_
Definition sht4x.h:40
@ SHT4X_PRECISION_MED
Definition sht4x.h:14
@ SHT4X_PRECISION_HIGH
Definition sht4x.h:14
@ SHT4X_PRECISION_LOW
Definition sht4x.h:14
@ SHT4X_HEATERPOWER_LOW
Definition sht4x.h:16
@ SHT4X_HEATERPOWER_HIGH
Definition sht4x.h:16
@ SHT4X_HEATERPOWER_MED
Definition sht4x.h:16
@ SHT4X_HEATERTIME_SHORT
Definition sht4x.h:18
@ SHT4X_HEATERTIME_LONG
Definition sht4x.h:18
static void uint32_t
char serial_number[10]
Definition sun_gtil2.cpp:15