ESPHome 2025.7.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
27#ifdef USE_BINARY_SENSOR
28 void set_motion(binary_sensor::BinarySensor *motion) { this->motion_ = motion; }
29 void set_motion_timeout(uint16_t timeout) { this->motion_timeout_ = timeout; }
30
31 void set_light(binary_sensor::BinarySensor *light) { this->light_ = light; }
32 void set_button(binary_sensor::BinarySensor *button) { this->button_ = button; }
33 void set_button_timeout(uint16_t timeout) { this->button_timeout_ = timeout; }
34#endif
35
36#ifdef USE_SENSOR
37 void set_battery_level(sensor::Sensor *battery_level) { battery_level_ = battery_level; }
38#endif
39
40 protected:
41 uint64_t address_;
42 uint8_t bindkey_[16];
43
44#ifdef USE_BINARY_SENSOR
47
51#endif
52#ifdef USE_SENSOR
54#endif
55};
56
57} // namespace xiaomi_rtcgq02lm
58} // namespace esphome
59
60#endif
uint8_t address
Definition bl0906.h:4
Base class for all binary_sensor-type classes.
Base-class for all sensors.
Definition sensor.h:62
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)
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7