ESPHome 2025.12.6
Loading...
Searching...
No Matches
esphome::text_sensor::PrependFilter Class Reference

A simple filter that adds a string to the start of another string. More...

#include <filter.h>

Inheritance diagram for esphome::text_sensor::PrependFilter:
esphome::text_sensor::Filter

Public Member Functions

 PrependFilter (const char *prefix)
 
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.
 
void input (const std::string &value)
 
void output (const std::string &value)
 

Protected Attributes

const char * prefix_
 
- Protected Attributes inherited from esphome::text_sensor::Filter
friend TextSensor
 
Filternext_ {nullptr}
 
TextSensorparent_ {nullptr}
 

Detailed Description

A simple filter that adds a string to the start of another string.

Definition at line 103 of file filter.h.

Constructor & Destructor Documentation

◆ PrependFilter()

esphome::text_sensor::PrependFilter::PrependFilter ( const char * prefix)
inlineexplicit

Definition at line 105 of file filter.h.

Member Function Documentation

◆ new_value()

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

Implements esphome::text_sensor::Filter.

Definition at line 65 of file filter.cpp.

Field Documentation

◆ prefix_

const char* esphome::text_sensor::PrependFilter::prefix_
protected

Definition at line 109 of file filter.h.


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