добавил название параметра

This commit is contained in:
Dmitry Borisenko
2021-12-19 22:36:52 +01:00
parent b0e06707bd
commit fd09ec9d6b
4 changed files with 7 additions and 3 deletions

View File

@@ -45,7 +45,8 @@ float yourSensorReading(String type, String paramsAny) {
if (type == "LCD") {
LCD_init();
LCD.setCursor(jsonReadInt(paramsAny, "с"), jsonReadInt(paramsAny, "k"));
LCD.print(jsonReadFloat(configLiveJson, jsonReadStr(paramsAny, "val")));
String toPrint = jsonReadStr(paramsAny, "descr") + " " + jsonReadStr(configLiveJson, jsonReadStr(paramsAny, "val"));
LCD.print(toPrint);
}
return value;
}

View File

@@ -18,6 +18,7 @@ SensorAny::SensorAny(const String& paramsAny) {
_addr = jsonReadStr(_paramsAny, "addr");
_type = jsonReadStr(_paramsAny, "type");
_val = jsonReadStr(_paramsAny, "val");
_descr = jsonReadStr(_paramsAny, "descr");
}
SensorAny::~SensorAny() {}
@@ -59,6 +60,7 @@ void AnySensor() {
jsonWriteStr(params, "k", myLineParsing.gk());
jsonWriteStr(params, "val", myLineParsing.gval());
jsonWriteStr(params, "type", myLineParsing.gtype());
jsonWriteStr(params, "descr", myLineParsing.gdescr());
myLineParsing.clear();
static bool firstTime = true;