ESPHome  2024.10.3
Public Member Functions | Protected Attributes
esphome::text_sensor::SubstituteFilter Class Reference

A simple filter that replaces a substring with another substring. More...

#include <filter.h>

Inheritance diagram for esphome::text_sensor::SubstituteFilter:
esphome::text_sensor::Filter

Public Member Functions

 SubstituteFilter (std::vector< std::string > from_strings, std::vector< std::string > to_strings)
 
optional< std::string > new_value (std::string value) override
 
- 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. More...
 
void input (const std::string &value)
 
void output (const std::string &value)
 

Protected Attributes

std::vector< std::string > from_strings_
 
std::vector< std::string > to_strings_
 
- Protected Attributes inherited from esphome::text_sensor::Filter
friend TextSensor
 
Filternext_ {nullptr}
 
TextSensorparent_ {nullptr}
 

Detailed Description

A simple filter that replaces a substring with another substring.

Definition at line 102 of file filter.h.

Constructor & Destructor Documentation

◆ SubstituteFilter()

esphome::text_sensor::SubstituteFilter::SubstituteFilter ( std::vector< std::string >  from_strings,
std::vector< std::string >  to_strings 
)
inline

Definition at line 104 of file filter.h.

Member Function Documentation

◆ new_value()

optional< std::string > esphome::text_sensor::SubstituteFilter::new_value ( std::string  value)
overridevirtual

Implements esphome::text_sensor::Filter.

Definition at line 65 of file filter.cpp.

Field Documentation

◆ from_strings_

std::vector<std::string> esphome::text_sensor::SubstituteFilter::from_strings_
protected

Definition at line 109 of file filter.h.

◆ to_strings_

std::vector<std::string> esphome::text_sensor::SubstituteFilter::to_strings_
protected

Definition at line 110 of file filter.h.


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