bool new_value(std::string &value) override
Apply a filter to text sensor values such as to_upper.
virtual bool new_value(std::string &value)=0
This will be called every time the filter receives a new value.
void output(std::string &value)
void input(std::string value)
virtual void initialize(TextSensor *parent, Filter *next)
Initialize this filter, please note this can be called more than once.
lambda_filter_t lambda_filter_
LambdaFilter(lambda_filter_t lambda_filter)
void set_lambda_filter(const lambda_filter_t &lambda_filter)
bool new_value(std::string &value) override
const lambda_filter_t & get_lambda_filter() const
bool new_value(std::string &value) override
MapFilter(const std::initializer_list< Substitution > &mappings)
FixedVector< Substitution > mappings_
bool new_value(std::string &value) override
FixedVector< Substitution > substitutions_
bool new_value(std::string &value) override
SubstituteFilter(const std::initializer_list< Substitution > &substitutions)
void internal_send_state_to_frontend(const std::string &state)
bool new_value(std::string &value) override
bool new_value(std::string &value) override
std::function< optional< std::string >(std::string)> lambda_filter_t