ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
b_parasite
b_parasite.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::b_parasite
{
8
9
class
BParasite
final :
public
Component
,
public
ble_device_base::ESPBTDeviceListener
{
10
SUB_SENSOR(battery_voltage)
11
SUB_SENSOR(
temperature
)
12
SUB_SENSOR(humidity)
13
SUB_SENSOR(soil_moisture)
14
SUB_SENSOR(illuminance)
15
16
public
:
17
void
set_address(uint64_t
address
) {
address_
=
address
; };
18
void
set_bindkey(
const
std::string &bindkey);
19
20
bool
parse_device(
const
ble_device_base::ESPBTDevice
&device)
override
;
21
void
dump_config()
override
;
22
23
protected
:
24
// The received advertisement packet contains an unsigned 4 bits wrap-around counter
25
// for deduplicating messages.
26
int8_t
last_processed_counter_
= -1;
27
uint64_t
address_
;
28
};
29
30
}
// namespace esphome::b_parasite
ble_device.h
esphome::Component
Definition
component.h:147
esphome::b_parasite::BParasite
Definition
b_parasite.h:9
esphome::b_parasite::BParasite::address_
uint64_t address_
Definition
b_parasite.h:27
esphome::b_parasite::BParasite::last_processed_counter_
int8_t last_processed_counter_
Definition
b_parasite.h:26
esphome::ble_device_base::ESPBTDevice
Definition
ble_device.h:178
esphome::ble_device_base::ESPBTDeviceListener
Definition
ble_device.h:284
component.h
esphome::b_parasite
Definition
b_parasite.cpp:5
esphome::libretiny::address
uint32_t address
Definition
crash_handler.cpp:375
sensor.h
temperature
uint16_t temperature
Definition
sun_gtil2.cpp:12
Generated by
1.12.0