ESPHome  2024.10.2
ld2420_binary_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../ld2420.h"
5 
6 namespace esphome {
7 namespace 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
void set_presence_sensor(binary_sensor::BinarySensor *bsensor)
binary_sensor::BinarySensor * presence_bsensor_
bool state
The current reported state of the binary sensor.
Definition: binary_sensor.h:61
void on_presence(bool presence) override
void publish_state(bool state)
Publish a new state to the front-end.
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base class for all binary_sensor-type classes.
Definition: binary_sensor.h:37