ESPHome  2024.11.0
xiaomi_cgg1.h
Go to the documentation of this file.
1 #pragma once
2 
7 
8 #ifdef USE_ESP32
9 
10 namespace esphome {
11 namespace xiaomi_cgg1 {
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 
20  void dump_config() override;
21  float get_setup_priority() const override { return setup_priority::DATA; }
23  void set_humidity(sensor::Sensor *humidity) { humidity_ = humidity; }
24  void set_battery_level(sensor::Sensor *battery_level) { battery_level_ = battery_level; }
25 
26  protected:
27  uint64_t address_;
28  uint8_t bindkey_[16];
32 };
33 
34 } // namespace xiaomi_cgg1
35 } // namespace esphome
36 
37 #endif
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
void set_bindkey(const std::string &bindkey)
Definition: xiaomi_cgg1.cpp:58
void set_humidity(sensor::Sensor *humidity)
Definition: xiaomi_cgg1.h:23
float get_setup_priority() const override
Definition: xiaomi_cgg1.h:21
uint16_t temperature
Definition: sun_gtil2.cpp:26
void set_temperature(sensor::Sensor *temperature)
Definition: xiaomi_cgg1.h:22
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override
Definition: xiaomi_cgg1.cpp:19
void set_address(uint64_t address)
Definition: xiaomi_cgg1.h:15
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
uint8_t address
Definition: bl0906.h:211
Base-class for all sensors.
Definition: sensor.h:57
sensor::Sensor * battery_level_
Definition: xiaomi_cgg1.h:31
void set_battery_level(sensor::Sensor *battery_level)
Definition: xiaomi_cgg1.h:24