void add_on_state_callback(std::function< void(std::string)> callback)
virtual std::string unique_id()
void add_filters(const std::vector< Filter *> &filters)
Add a list of vectors to the back of the filter chain.
void publish_state(const std::string &state)
void add_on_raw_state_callback(std::function< void(std::string)> callback)
Add a callback that will be called every time the sensor sends a raw value.
void add_filter(Filter *filter)
Add a filter to the filter chain. Will be appended to the back.
CallbackManager< void(std::string)> callback_
Storage for filtered state callbacks.
void internal_send_state_to_frontend(const std::string &state)
std::string get_state() const
Getter-syntax for .state.
void set_filters(const std::vector< Filter *> &filters)
Clear the filters and replace them by filters.
Filter * filter_list_
Store all active filters.
void clear_filters()
Clear the entire filter chain.
Apply a filter to text sensor values such as to_upper.
std::string get_raw_state() const
Getter-syntax for .raw_state.
CallbackManager< void(std::string)> raw_callback_
Storage for raw state callbacks.