ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
thermopro_ble.h
Go to the documentation of this file.
1#pragma once
2
6
8
9struct ParseResult {
10 optional<float> temperature;
11 optional<float> external_temperature;
12 optional<float> humidity;
13 optional<float> battery_level;
14};
15
16using DeviceParser = optional<ParseResult> (*)(const uint8_t *data, std::size_t data_size);
17
19 SUB_SENSOR(signal_strength)
20 SUB_SENSOR(temperature)
21 SUB_SENSOR(external_temperature)
22 SUB_SENSOR(humidity)
23 SUB_SENSOR(battery_level)
24
25 public:
26 void set_address(uint64_t address) { this->address_ = address; };
27
28 bool parse_device(const ble_device_base::ESPBTDevice &device) override;
29 void dump_config() override;
30
31 protected:
32 uint64_t address_;
33};
34
35} // namespace esphome::thermopro_ble
optional< ParseResult >(*)(const uint8_t *data, std::size_t data_size) DeviceParser
uint16_t temperature
Definition sun_gtil2.cpp:12