ESPHome  2024.11.0
b_parasite.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 #ifdef USE_ESP32
8 
9 namespace esphome {
10 namespace b_parasite {
11 
13  public:
14  void set_address(uint64_t address) { address_ = address; };
15  void set_bindkey(const std::string &bindkey);
16 
17  bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override;
18  void dump_config() override;
19  float get_setup_priority() const override { return setup_priority::DATA; }
20 
21  void set_battery_voltage(sensor::Sensor *battery_voltage) { battery_voltage_ = battery_voltage; }
23  void set_humidity(sensor::Sensor *humidity) { humidity_ = humidity; }
24  void set_soil_moisture(sensor::Sensor *soil_moisture) { soil_moisture_ = soil_moisture; }
25  void set_illuminance(sensor::Sensor *illuminance) { illuminance_ = illuminance; }
26 
27  protected:
28  // The received advertisement packet contains an unsigned 4 bits wrap-around counter
29  // for deduplicating messages.
31  uint64_t address_;
37 };
38 
39 } // namespace b_parasite
40 } // namespace esphome
41 
42 #endif // USE_ESP32
const float DATA
For components that import data from directly connected sensors like DHT.
Definition: component.cpp:19
float get_setup_priority() const override
Definition: b_parasite.h:19
sensor::Sensor * battery_voltage_
Definition: b_parasite.h:32
sensor::Sensor * illuminance_
Definition: b_parasite.h:36
sensor::Sensor * humidity_
Definition: b_parasite.h:34
void set_battery_voltage(sensor::Sensor *battery_voltage)
Definition: b_parasite.h:21
void set_illuminance(sensor::Sensor *illuminance)
Definition: b_parasite.h:25
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override
Definition: b_parasite.cpp:20
void set_soil_moisture(sensor::Sensor *soil_moisture)
Definition: b_parasite.h:24
sensor::Sensor * soil_moisture_
Definition: b_parasite.h:35
void set_bindkey(const std::string &bindkey)
void set_address(uint64_t address)
Definition: b_parasite.h:14
void set_temperature(sensor::Sensor *temperature)
Definition: b_parasite.h:22
uint16_t temperature
Definition: sun_gtil2.cpp:26
void set_humidity(sensor::Sensor *humidity)
Definition: b_parasite.h:23
sensor::Sensor * temperature_
Definition: b_parasite.h:33
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