ESPHome
2026.2.3
Loading...
Searching...
No Matches
esphome
components
wts01
wts01.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/uart/uart.h
"
6
7
namespace
esphome
{
8
namespace
wts01 {
9
10
constexpr
uint8_t
PACKET_SIZE
= 9;
11
12
class
WTS01Sensor
:
public
sensor::Sensor
,
public
uart::UARTDevice
,
public
Component
{
13
public
:
14
void
loop
()
override
;
15
void
dump_config
()
override
;
16
17
protected
:
18
uint8_t
buffer_
[
PACKET_SIZE
];
19
uint8_t
buffer_pos_
{0};
20
21
void
handle_char_
(uint8_t c);
22
void
process_packet_
();
23
};
24
25
}
// namespace wts01
26
}
// namespace esphome
esphome::Component
Definition
component.h:84
esphome::sensor::Sensor
Base-class for all sensors.
Definition
sensor.h:43
esphome::uart::UARTDevice
Definition
uart.h:11
esphome::wts01::WTS01Sensor
Definition
wts01.h:12
esphome::wts01::WTS01Sensor::buffer_pos_
uint8_t buffer_pos_
Definition
wts01.h:19
esphome::wts01::WTS01Sensor::handle_char_
void handle_char_(uint8_t c)
Definition
wts01.cpp:27
esphome::wts01::WTS01Sensor::process_packet_
void process_packet_()
Definition
wts01.cpp:58
esphome::wts01::WTS01Sensor::buffer_
uint8_t buffer_[PACKET_SIZE]
Definition
wts01.h:18
esphome::wts01::WTS01Sensor::dump_config
void dump_config() override
Definition
wts01.cpp:25
esphome::wts01::WTS01Sensor::loop
void loop() override
Definition
wts01.cpp:15
component.h
esphome::wts01::PACKET_SIZE
constexpr uint8_t PACKET_SIZE
Definition
wts01.h:10
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
sensor.h
uart.h
Generated by
1.12.0