ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
thermopro_ble
thermopro_ble.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/sensor/sensor.h
"
5
#include "
esphome/components/ble_device_base/ble_device.h
"
6
7
namespace
esphome::thermopro_ble
{
8
9
struct
ParseResult
{
10
optional<float>
temperature
;
11
optional<float>
external_temperature
;
12
optional<float>
humidity
;
13
optional<float>
battery_level
;
14
};
15
16
using
DeviceParser
= optional<ParseResult> (*)(
const
uint8_t *data, std::size_t data_size);
17
18
class
ThermoProBLE
final :
public
Component
,
public
ble_device_base::ESPBTDeviceListener
{
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
ble_device.h
esphome::Component
Definition
component.h:147
esphome::ble_device_base::ESPBTDevice
Definition
ble_device.h:178
esphome::ble_device_base::ESPBTDeviceListener
Definition
ble_device.h:284
esphome::thermopro_ble::ThermoProBLE
Definition
thermopro_ble.h:18
esphome::thermopro_ble::ThermoProBLE::address_
uint64_t address_
Definition
thermopro_ble.h:32
component.h
esphome::libretiny::address
uint32_t address
Definition
crash_handler.cpp:375
esphome::thermopro_ble
Definition
thermopro_ble.cpp:6
esphome::thermopro_ble::DeviceParser
optional< ParseResult >(*)(const uint8_t *data, std::size_t data_size) DeviceParser
Definition
thermopro_ble.h:16
sensor.h
esphome::thermopro_ble::ParseResult
Definition
thermopro_ble.h:9
esphome::thermopro_ble::ParseResult::humidity
optional< float > humidity
Definition
thermopro_ble.h:12
esphome::thermopro_ble::ParseResult::battery_level
optional< float > battery_level
Definition
thermopro_ble.h:13
esphome::thermopro_ble::ParseResult::external_temperature
optional< float > external_temperature
Definition
thermopro_ble.h:11
esphome::thermopro_ble::ParseResult::temperature
optional< float > temperature
Definition
thermopro_ble.h:10
temperature
uint16_t temperature
Definition
sun_gtil2.cpp:12
Generated by
1.12.0