ESPHome
2026.5.1
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::wts01
{
8
9
constexpr
uint8_t
PACKET_SIZE
= 9;
10
11
class
WTS01Sensor
:
public
sensor::Sensor
,
public
uart::UARTDevice
,
public
Component
{
12
public
:
13
void
loop
()
override
;
14
void
dump_config
()
override
;
15
16
protected
:
17
uint8_t
buffer_
[
PACKET_SIZE
];
18
uint8_t
buffer_pos_
{0};
19
20
void
handle_char_
(uint8_t c);
21
void
process_packet_
();
22
};
23
24
}
// namespace esphome::wts01
esphome::Component
Definition
component.h:145
esphome::sensor::Sensor
Base-class for all sensors.
Definition
sensor.h:47
esphome::uart::UARTDevice
Definition
uart.h:11
esphome::wts01::WTS01Sensor
Definition
wts01.h:11
esphome::wts01::WTS01Sensor::buffer_pos_
uint8_t buffer_pos_
Definition
wts01.h:18
esphome::wts01::WTS01Sensor::handle_char_
void handle_char_(uint8_t c)
Definition
wts01.cpp:26
esphome::wts01::WTS01Sensor::process_packet_
void process_packet_()
Definition
wts01.cpp:57
esphome::wts01::WTS01Sensor::buffer_
uint8_t buffer_[PACKET_SIZE]
Definition
wts01.h:17
esphome::wts01::WTS01Sensor::dump_config
void dump_config() override
Definition
wts01.cpp:24
esphome::wts01::WTS01Sensor::loop
void loop() override
Definition
wts01.cpp:14
component.h
esphome::wts01
Definition
wts01.cpp:5
esphome::wts01::PACKET_SIZE
constexpr uint8_t PACKET_SIZE
Definition
wts01.h:9
sensor.h
uart.h
Generated by
1.12.0