ESPHome  2022.8.0
xiaomi_lywsd03mmc.h
Go to the documentation of this file.
1 #pragma once
2 
7 
8 #ifdef USE_ESP32
9 
10 namespace esphome {
11 namespace xiaomi_lywsd03mmc {
12 
14  public:
15  void set_address(uint64_t address) { address_ = address; };
16  void set_bindkey(const std::string &bindkey);
17 
18  bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override;
19  void dump_config() override;
20  float get_setup_priority() const override { return setup_priority::DATA; }
22  void set_humidity(sensor::Sensor *humidity) { humidity_ = humidity; }
23  void set_battery_level(sensor::Sensor *battery_level) { battery_level_ = battery_level; }
24 
25  protected:
26  uint64_t address_;
27  uint8_t bindkey_[16];
31 };
32 
33 } // namespace xiaomi_lywsd03mmc
34 } // namespace esphome
35 
36 #endif
void set_temperature(sensor::Sensor *temperature)
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:18
float temperature
Definition: qmp6988.h:71
void set_humidity(sensor::Sensor *humidity)
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override
Definition: a4988.cpp:4
void set_battery_level(sensor::Sensor *battery_level)
Base-class for all sensors.
Definition: sensor.h:48
void set_bindkey(const std::string &bindkey)