|
ESPHome 2026.4.5
|
This class allows for creation of simple template filters. More...
#include <filter.h>
Public Member Functions | |
| LambdaFilter (lambda_filter_t lambda_filter) | |
| bool | new_value (std::string &value) override |
| const lambda_filter_t & | get_lambda_filter () const |
| void | set_lambda_filter (const lambda_filter_t &lambda_filter) |
Public Member Functions inherited from esphome::text_sensor::Filter | |
| virtual void | initialize (TextSensor *parent, Filter *next) |
| Initialize this filter, please note this can be called more than once. | |
| void | input (std::string value) |
| void | output (std::string &value) |
Protected Attributes | |
| lambda_filter_t | lambda_filter_ |
Protected Attributes inherited from esphome::text_sensor::Filter | |
| friend | TextSensor |
| Filter * | next_ {nullptr} |
| TextSensor * | parent_ {nullptr} |
This class allows for creation of simple template filters.
The constructor accepts a lambda of the form std::string -> optional<std::string>. Return a modified string to continue the chain, or return {} to stop (value will not be published).
|
explicit |
Definition at line 35 of file filter.cpp.
| const lambda_filter_t & esphome::text_sensor::LambdaFilter::get_lambda_filter | ( | ) | const |
Definition at line 36 of file filter.cpp.
|
overridevirtual |
Implements esphome::text_sensor::Filter.
Definition at line 39 of file filter.cpp.
| void esphome::text_sensor::LambdaFilter::set_lambda_filter | ( | const lambda_filter_t & | lambda_filter | ) |
Definition at line 37 of file filter.cpp.
|
protected |