ESPHome 2025.5.0
Loading...
Searching...
No Matches
ld2420_binary_sensor.h
Go to the documentation of this file.
1#pragma once
2
3#include "../ld2420.h"
5
6namespace esphome {
7namespace ld2420 {
8
10 public:
11 void dump_config() override;
13 void on_presence(bool presence) override {
14 if (this->presence_bsensor_ != nullptr) {
15 if (this->presence_bsensor_->state != presence)
16 this->presence_bsensor_->publish_state(presence);
17 }
18 }
19
20 protected:
22};
23
24} // namespace ld2420
25} // namespace esphome
Base class for all binary_sensor-type classes.
bool state
The current reported state of the binary sensor.
void publish_state(bool state)
Publish a new state to the front-end.
void on_presence(bool presence) override
binary_sensor::BinarySensor * presence_bsensor_
void set_presence_sensor(binary_sensor::BinarySensor *bsensor)
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7