1#ifndef _SENSESP_UI_UI_OUTPUT_H_
2#define _SENSESP_UI_UI_OUTPUT_H_
3#include <ArduinoJson.h>
43 std::function<T()> value_function_;
51 T
get() {
return value_function_(); }
55 output[
"Value"] =
get();
61extern std::map<String, UIOutputBase*>
ui_outputs;
A base class which allow observers to attach callbacks to themselves. The callbacks will be called wh...
A value that notifies its observers if it gets changed.
UILambdaOutput(String name, std::function< T()> function, String group=kUIOutputDefaultGroup, int order=kUIOutputDefaultOrder)
void set_json(const JsonObject &obj) override
static const std::map< String, UIOutputBase * > * get_ui_outputs()
UIOutputBase(String name, String group, int order)
static std::map< String, UIOutputBase * > ui_outputs_
virtual void set_json(const JsonObject &obj)
void set_json(const JsonObject &obj) override
void set_input(T new_value, uint8_t input_channel=0) override
UIOutput(String name, T value, String group=kUIOutputDefaultGroup, int order=kUIOutputDefaultOrder)
A base class for piece of code (like a transform) that accepts data for input. ValueConsumers can acc...
virtual const T & get() const
constexpr int kUIOutputDefaultOrder
constexpr char kUIOutputDefaultGroup[]
std::map< String, UIOutputBase * > ui_outputs