ESPHome 2025.10.0-dev
Loading...
Searching...
No Matches
wts01.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace wts01 {
9
10constexpr uint8_t PACKET_SIZE = 9;
11
12class WTS01Sensor : public sensor::Sensor, public uart::UARTDevice, public Component {
13 public:
14 void loop() override;
15 void dump_config() override;
16 float get_setup_priority() const override { return setup_priority::DATA; }
17
18 protected:
20 uint8_t buffer_pos_{0};
21
22 void handle_char_(uint8_t c);
23 void process_packet_();
24};
25
26} // namespace wts01
27} // namespace esphome
Base-class for all sensors.
Definition sensor.h:42
void handle_char_(uint8_t c)
Definition wts01.cpp:27
float get_setup_priority() const override
Definition wts01.h:16
uint8_t buffer_[PACKET_SIZE]
Definition wts01.h:19
void dump_config() override
Definition wts01.cpp:25
void loop() override
Definition wts01.cpp:15
const float DATA
For components that import data from directly connected sensors like DHT.
Definition component.cpp:49
constexpr uint8_t PACKET_SIZE
Definition wts01.h:10
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7