ESPHome 2025.6.0
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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
16namespace esphome {
17namespace seeed_mr60bha2 {
18static const uint8_t FRAME_HEADER_BUFFER = 0x01;
19static const uint16_t BREATH_RATE_TYPE_BUFFER = 0x0A14;
20static const uint16_t PEOPLE_EXIST_TYPE_BUFFER = 0x0F09;
21static const uint16_t HEART_RATE_TYPE_BUFFER = 0x0A15;
22static const uint16_t DISTANCE_TYPE_BUFFER = 0x0A16;
23static const uint16_t PRINT_CLOUD_BUFFER = 0x0A04;
24
26 public uart::UARTDevice { // The class name must be the name defined by text_sensor.py
27#ifdef USE_BINARY_SENSOR
28 SUB_BINARY_SENSOR(has_target);
29#endif
30#ifdef USE_SENSOR
31 SUB_SENSOR(breath_rate);
32 SUB_SENSOR(heart_rate);
33 SUB_SENSOR(distance);
34 SUB_SENSOR(num_targets);
35#endif
36
37 public:
38 float get_setup_priority() const override { return esphome::setup_priority::LATE; }
39 void dump_config() override;
40 void loop() override;
41
42 protected:
43 bool validate_message_();
44 void process_frame_(uint16_t frame_id, uint16_t frame_type, const uint8_t *data, size_t length);
45
46 std::vector<uint8_t> rx_message_;
47};
48
49} // namespace seeed_mr60bha2
50} // namespace esphome
void process_frame_(uint16_t frame_id, uint16_t frame_type, const uint8_t *data, size_t length)
const float LATE
For components that should be initialized at the very end of the setup process.
Definition component.cpp:29
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint16_t length
Definition tt21100.cpp:0