ESPHome  2024.10.2
xiaomi_mjyd02yla.h
Go to the documentation of this file.
1 #pragma once
2 
8 
9 #ifdef USE_ESP32
10 
11 namespace esphome {
12 namespace xiaomi_mjyd02yla {
13 
14 class XiaomiMJYD02YLA : public Component,
17  public:
18  void set_address(uint64_t address) { address_ = address; }
19  void set_bindkey(const std::string &bindkey);
20 
21  bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override;
22 
23  void dump_config() override;
24  float get_setup_priority() const override { return setup_priority::DATA; }
25  void set_idle_time(sensor::Sensor *idle_time) { idle_time_ = idle_time; }
26  void set_battery_level(sensor::Sensor *battery_level) { battery_level_ = battery_level; }
27  void set_illuminance(sensor::Sensor *illuminance) { illuminance_ = illuminance; }
29 
30  protected:
31  uint64_t address_;
32  uint8_t bindkey_[16];
37 };
38 
39 } // namespace xiaomi_mjyd02yla
40 } // namespace esphome
41 
42 #endif
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
void set_light(binary_sensor::BinarySensor *light)
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override
void set_idle_time(sensor::Sensor *idle_time)
void set_bindkey(const std::string &bindkey)
void set_illuminance(sensor::Sensor *illuminance)
binary_sensor::BinarySensor * is_light_
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
uint8_t address
Definition: bl0906.h:211
Base class for all binary_sensor-type classes.
Definition: binary_sensor.h:37
void set_battery_level(sensor::Sensor *battery_level)
Base-class for all sensors.
Definition: sensor.h:57