ESPHome 2026.5.1
Loading...
Searching...
No Matches
seeed_mr60bha2.h
Go to the documentation of this file.
1#pragma once
4#ifdef USE_BINARY_SENSOR
6#endif
7#ifdef USE_SENSOR
9#endif
13
14#include <map>
15
17static const uint8_t FRAME_HEADER_BUFFER = 0x01;
18static const uint16_t BREATH_RATE_TYPE_BUFFER = 0x0A14;
19static const uint16_t PEOPLE_EXIST_TYPE_BUFFER = 0x0F09;
20static const uint16_t HEART_RATE_TYPE_BUFFER = 0x0A15;
21static const uint16_t DISTANCE_TYPE_BUFFER = 0x0A16;
22static const uint16_t PRINT_CLOUD_BUFFER = 0x0A04;
23
25 public uart::UARTDevice { // The class name must be the name defined by text_sensor.py
26#ifdef USE_BINARY_SENSOR
27 SUB_BINARY_SENSOR(has_target);
28#endif
29#ifdef USE_SENSOR
30 SUB_SENSOR(breath_rate);
31 SUB_SENSOR(heart_rate);
32 SUB_SENSOR(distance);
33 SUB_SENSOR(num_targets);
34#endif
35
36 public:
37 float get_setup_priority() const override { return esphome::setup_priority::LATE; }
38 void dump_config() override;
39 void loop() override;
40
41 protected:
42 bool validate_message_();
43 void process_frame_(uint16_t frame_id, uint16_t frame_type, const uint8_t *data, size_t length);
44
45 std::vector<uint8_t> rx_message_;
46};
47
48} // namespace esphome::seeed_mr60bha2
void process_frame_(uint16_t frame_id, uint16_t frame_type, const uint8_t *data, size_t length)
constexpr float LATE
For components that should be initialized at the very end of the setup process.
Definition component.h:57
uint16_t length
Definition tt21100.cpp:0