ESPHome 2026.5.1
Loading...
Searching...
No Matches
wts01.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::wts01 {
8
9constexpr uint8_t PACKET_SIZE = 9;
10
11class WTS01Sensor : public sensor::Sensor, public uart::UARTDevice, public Component {
12 public:
13 void loop() override;
14 void dump_config() override;
15
16 protected:
18 uint8_t buffer_pos_{0};
19
20 void handle_char_(uint8_t c);
21 void process_packet_();
22};
23
24} // namespace esphome::wts01
Base-class for all sensors.
Definition sensor.h:47
void handle_char_(uint8_t c)
Definition wts01.cpp:26
uint8_t buffer_[PACKET_SIZE]
Definition wts01.h:17
void dump_config() override
Definition wts01.cpp:24
void loop() override
Definition wts01.cpp:14
constexpr uint8_t PACKET_SIZE
Definition wts01.h:9