ESPHome  2024.10.3
Public Member Functions | Protected Attributes
esphome::binary_sensor::LambdaFilter Class Reference

#include <filter.h>

Inheritance diagram for esphome::binary_sensor::LambdaFilter:
esphome::binary_sensor::Filter

Public Member Functions

 LambdaFilter (std::function< optional< bool >(bool)> f)
 
optional< bool > new_value (bool value, bool is_initial) override
 
- Public Member Functions inherited from esphome::binary_sensor::Filter
void input (bool value, bool is_initial)
 
void output (bool value, bool is_initial)
 

Protected Attributes

std::function< optional< bool >bool)> f_
 
- Protected Attributes inherited from esphome::binary_sensor::Filter
friend BinarySensor
 
Filternext_ {nullptr}
 
BinarySensorparent_ {nullptr}
 
Deduplicator< bool > dedup_
 

Detailed Description

Definition at line 101 of file filter.h.

Constructor & Destructor Documentation

◆ LambdaFilter()

esphome::binary_sensor::LambdaFilter::LambdaFilter ( std::function< optional< bool >(bool)>  f)
explicit

Definition at line 110 of file filter.cpp.

Member Function Documentation

◆ new_value()

optional< bool > esphome::binary_sensor::LambdaFilter::new_value ( bool  value,
bool  is_initial 
)
overridevirtual

Implements esphome::binary_sensor::Filter.

Definition at line 112 of file filter.cpp.

Field Documentation

◆ f_

std::function<optional<bool>bool)> esphome::binary_sensor::LambdaFilter::f_
protected

Definition at line 108 of file filter.h.


The documentation for this class was generated from the following files: