ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
aht10
aht10.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <utility>
4
5
#include "
esphome/core/component.h
"
6
#include "
esphome/components/sensor/sensor.h
"
7
#include "
esphome/components/i2c/i2c.h
"
8
9
namespace
esphome::aht10
{
10
11
enum
AHT10Variant
{
AHT10
,
AHT20
};
12
13
class
AHT10Component
final :
public
PollingComponent
,
public
i2c::I2CDevice
{
14
SUB_SENSOR(
temperature
)
15
SUB_SENSOR(humidity)
16
17
public
:
18
void
setup
()
override
;
19
void
update()
override
;
20
void
dump_config()
override
;
21
void
set_variant(
AHT10Variant
variant) { this->
variant_
= variant; }
22
23
protected
:
24
AHT10Variant
variant_
{};
25
unsigned
read_count_
{};
26
void
read_data_
();
27
void
restart_read_
();
28
uint32_t
start_time_
{};
29
};
30
31
}
// namespace esphome::aht10
esphome::Component::setup
virtual void setup()
Where the component's initialization should happen.
Definition
component.cpp:84
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition
component.h:532
esphome::aht10::AHT10Component
Definition
aht10.h:13
esphome::aht10::AHT10Component::read_data_
void read_data_()
Definition
aht10.cpp:88
esphome::aht10::AHT10Component::variant_
AHT10Variant variant_
Definition
aht10.h:24
esphome::aht10::AHT10Component::start_time_
uint32_t start_time_
Definition
aht10.h:28
esphome::aht10::AHT10Component::read_count_
unsigned read_count_
Definition
aht10.h:25
esphome::aht10::AHT10Component::restart_read_
void restart_read_()
Definition
aht10.cpp:78
esphome::i2c::I2CDevice
This Class provides the methods to read/write bytes from/to an i2c device.
Definition
i2c.h:144
component.h
i2c.h
esphome::aht10
Definition
aht10.cpp:20
esphome::aht10::AHT10Variant
AHT10Variant
Definition
aht10.h:11
esphome::aht10::AHT10
@ AHT10
Definition
aht10.h:11
esphome::aht10::AHT20
@ AHT20
Definition
aht10.h:11
uint32_t
static void uint32_t
Definition
crash_handler.cpp:153
sensor.h
temperature
uint16_t temperature
Definition
sun_gtil2.cpp:12
Generated by
1.12.0