SensESP 3.0.1
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
threshold.cpp
Go to the documentation of this file.
1#include "threshold.h"
2
3namespace sensesp {
4
5static const char kSchemaTemplate[] =
6 R"({"type":"object","properties":{"min":{"title":"Minimum value","type":"!!TYPE!!","description":"Minimum value to be 'in range'"},"max":{"title":"Maximum value","type":"!!TYPE!!","description":"Maximum value to be 'in range'"},"in_range":{"title":"In range value","type":"boolean","description":"When checked, output true when input value is 'in range'"}}})";
7
8const String ConfigSchema(const ThresholdTransform<float>& obj) {
9 String schema = kSchemaTemplate;
10 schema.replace("!!TYPE!!", "number");
11 return schema;
12}
13
14const String ConfigSchema(const ThresholdTransform<int>& obj) {
15 String schema = kSchemaTemplate;
16 schema.replace("!!TYPE!!", "integer");
17 return schema;
18}
19
20} // namespace sensesp
A Transform base class that translates the value of type C into boolean. Base class for classes Float...
Definition threshold.h:22
const String ConfigSchema(const SmartSwitchController &obj)