1#ifndef SENSESP_SYSTEM_VALUECONSUMER_H_
2#define SENSESP_SYSTEM_VALUECONSUMER_H_
6#include <ArduinoJson.h>
32 virtual void set(
const T& new_value) {}
34 [[deprecated(
"Use set() instead")]]
41 [[deprecated(
"Use ValueProducer<T>::connect_to instead")]]
43 producer->
attach([producer,
this]() { this->
set(producer->
get()); });
void attach(std::function< void()> observer)
A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can acc...
void connect_from(ValueProducer< T > *producer)
virtual void set(const T &new_value)
virtual void set_input(const T &new_value)
A base class for any sensor or piece of code that outputs a value for consumption elsewhere.
virtual const T & get() const
ValueConsumer< bool > BoolConsumer
ValueConsumer< float > FloatConsumer
ValueConsumer< String > StringConsumer
ValueConsumer< int > IntConsumer