ESPHome 2025.5.0
Loading...
Searching...
No Matches
xiaomi_rtcgq02lm.h
Go to the documentation of this file.
1#pragma once
2
5#ifdef USE_BINARY_SENSOR
7#endif
8#ifdef USE_SENSOR
10#endif
13
14#ifdef USE_ESP32
15
16namespace esphome {
17namespace xiaomi_rtcgq02lm {
18
20 public:
21 void set_address(uint64_t address) { address_ = address; };
22 void set_bindkey(const std::string &bindkey);
23
24 bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override;
25 void dump_config() override;
26 float get_setup_priority() const override { return setup_priority::DATA; }
27
28#ifdef USE_BINARY_SENSOR
29 void set_motion(binary_sensor::BinarySensor *motion) { this->motion_ = motion; }
30 void set_motion_timeout(uint16_t timeout) { this->motion_timeout_ = timeout; }
31
32 void set_light(binary_sensor::BinarySensor *light) { this->light_ = light; }
33 void set_button(binary_sensor::BinarySensor *button) { this->button_ = button; }
34 void set_button_timeout(uint16_t timeout) { this->button_timeout_ = timeout; }
35#endif
36
37#ifdef USE_SENSOR
38 void set_battery_level(sensor::Sensor *battery_level) { battery_level_ = battery_level; }
39#endif
40
41 protected:
42 uint64_t address_;
43 uint8_t bindkey_[16];
44
45#ifdef USE_BINARY_SENSOR
48
52#endif
53#ifdef USE_SENSOR
55#endif
56};
57
58} // namespace xiaomi_rtcgq02lm
59} // namespace esphome
60
61#endif
uint8_t address
Definition bl0906.h:4
Base class for all binary_sensor-type classes.
Base-class for all sensors.
Definition sensor.h:57
binary_sensor::BinarySensor * motion_
void set_motion(binary_sensor::BinarySensor *motion)
binary_sensor::BinarySensor * button_
void set_button(binary_sensor::BinarySensor *button)
void set_bindkey(const std::string &bindkey)
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override
void set_battery_level(sensor::Sensor *battery_level)
void set_light(binary_sensor::BinarySensor *light)
const float DATA
For components that import data from directly connected sensors like DHT.
Definition component.cpp:19
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7