ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
smt100
smt100.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/core/line_reader.h
"
6
#include "
esphome/components/uart/uart.h
"
7
8
namespace
esphome::smt100
{
9
10
class
SMT100Component
final :
public
PollingComponent
,
public
uart::UARTDevice
{
11
// 33 characters plus the NUL; the longest line, "15000,80.00,100.00,-20.00,12.00", is 31
12
static
constexpr
uint16_t LINE_BUFFER_SIZE = 34;
13
14
public
:
15
SMT100Component
() =
default
;
16
17
void
dump_config
()
override
;
18
void
loop
()
override
;
19
void
update
()
override
;
20
21
SUB_SENSOR(counts)
22
SUB_SENSOR(permittivity)
23
SUB_SENSOR(
temperature
)
24
SUB_SENSOR(moisture)
25
SUB_SENSOR(voltage)
26
27
protected
:
28
LineReader
<LINE_BUFFER_SIZE,
'\r'
,
'\n'
> line_reader_;
29
30
uint32_t
last_transmission_
{0};
31
};
32
33
}
// namespace esphome::smt100
esphome::LineReader
Collects bytes into NUL terminated lines of up to N - 1 characters; IGNORE_CHAR bytes are skipped and...
Definition
line_reader.h:15
esphome::PollingComponent
This class simplifies creating components that periodically check a state.
Definition
component.h:532
esphome::smt100::SMT100Component
Definition
smt100.h:10
esphome::smt100::SMT100Component::SMT100Component
SMT100Component()=default
esphome::smt100::SMT100Component::loop
void loop() override
Definition
smt100.cpp:13
esphome::smt100::SMT100Component::dump_config
void dump_config() override
Definition
smt100.cpp:54
esphome::smt100::SMT100Component::last_transmission_
SUB_SENSOR(counts) SUB_SENSOR(permittivity) SUB_SENSOR(temperature) SUB_SENSOR(moisture) SUB_SENSOR(voltage) protected uint32_t last_transmission_
Definition
smt100.h:30
esphome::smt100::SMT100Component::update
void update() override
Definition
smt100.cpp:8
esphome::uart::UARTDevice
Definition
uart.h:15
component.h
line_reader.h
esphome::smt100
Definition
smt100.cpp:4
uint32_t
static void uint32_t
Definition
crash_handler.cpp:153
sensor.h
temperature
uint16_t temperature
Definition
sun_gtil2.cpp:12
uart.h
Generated by
1.12.0