ESPHome  2024.6.6
Public Member Functions | Protected Attributes
esphome::text_sensor::MapFilter Class Reference

A filter that maps values from one set to another. More...

#include <filter.h>

Inheritance diagram for esphome::text_sensor::MapFilter:

Public Member Functions

 MapFilter (std::map< std::string, std::string > mappings)
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::map< std::string, std::string > mappings_
- Protected Attributes inherited from esphome::text_sensor::Filter
friend TextSensor
Filternext_ {nullptr}
TextSensorparent_ {nullptr}

Detailed Description

A filter that maps values from one set to another.

Definition at line 114 of file filter.h.

Constructor & Destructor Documentation

◆ MapFilter()

esphome::text_sensor::MapFilter::MapFilter ( std::map< std::string, std::string >  mappings)

Definition at line 116 of file filter.h.

Member Function Documentation

◆ new_value()

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

Implements esphome::text_sensor::Filter.

Definition at line 75 of file filter.cpp.

Field Documentation

◆ mappings_

std::map<std::string, std::string> esphome::text_sensor::MapFilter::mappings_

Definition at line 120 of file filter.h.

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