ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
shtcx
shtcx.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/sensor/sensor.h
"
5
#include "
esphome/components/sensirion_common/i2c_sensirion.h
"
6
7
namespace
esphome::shtcx
{
8
9
enum
SHTCXType
: uint8_t {
10
SHTCX_TYPE_SHTC3
= 0,
11
SHTCX_TYPE_SHTC1
,
12
SHTCX_TYPE_UNKNOWN
,
13
};
14
16
class
SHTCXComponent
final :
public
PollingComponent
,
public
sensirion_common::SensirionI2CDevice
{
17
SUB_SENSOR(
temperature
)
18
SUB_SENSOR(humidity)
19
20
public
:
21
void
setup
()
override
;
22
void
dump_config()
override
;
23
void
update()
override
;
24
void
soft_reset();
25
void
sleep();
26
void
wake_up();
27
28
protected
:
29
uint16_t
sensor_id_
;
30
SHTCXType
type_
;
31
};
32
33
}
// namespace esphome::shtcx
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::sensirion_common::SensirionI2CDevice
Definition
i2c_sensirion.h:22
esphome::shtcx::SHTCXComponent
This class implements support for the SHT3x-DIS family of temperature+humidity i2c sensors.
Definition
shtcx.h:16
esphome::shtcx::SHTCXComponent::sensor_id_
uint16_t sensor_id_
Definition
shtcx.h:29
esphome::shtcx::SHTCXComponent::type_
SHTCXType type_
Definition
shtcx.h:30
component.h
i2c_sensirion.h
esphome::shtcx
Definition
shtcx.cpp:5
esphome::shtcx::SHTCXType
SHTCXType
Definition
shtcx.h:9
esphome::shtcx::SHTCX_TYPE_SHTC1
@ SHTCX_TYPE_SHTC1
Definition
shtcx.h:11
esphome::shtcx::SHTCX_TYPE_UNKNOWN
@ SHTCX_TYPE_UNKNOWN
Definition
shtcx.h:12
esphome::shtcx::SHTCX_TYPE_SHTC3
@ SHTCX_TYPE_SHTC3
Definition
shtcx.h:10
sensor.h
temperature
uint16_t temperature
Definition
sun_gtil2.cpp:12
Generated by
1.12.0