Merge pull request #105 from DmitryBorisenko33/ver3

добавил название параметра
This commit is contained in:
Dmitry Borisenko
2021-12-19 22:37:45 +01:00
committed by GitHub
4 changed files with 7 additions and 3 deletions

View File

@@ -38,6 +38,6 @@
0;sensor;anyid;anydata;Сенсоры;Параметр;1;c[1];int[10];type[HDC1080_hum];addr[0x76]*
0;sensor;anyid;anydata;Сенсоры;Параметр;1;c[1];int[10];type[AHTX0_temp];addr[0x76]
0;sensor;anyid;anydata;Сенсоры;Параметр;1;c[1];int[10];type[AHTX0_hum];addr[0x76]*
0;sensor;anyid;anydata;Сенсоры;Параметр;1;c[0];k[0];int[10];type[LCD];val[any]
0;sensor;anyid;anydata;Сенсоры;Параметр;1;c[8];k[1];int[10];type[LCD];val[any]*
0;sensor;anyid;anydata;Page;Tmp;1;c[0];k[0];int[10];type[LCD];val[any]
0;sensor;anyid;anydata;Page;Hum;1;c[8];k[1];int[10];type[LCD];val[any]*
0;sensor;anyid;anydata;Сенсоры;Параметр;1;c[1];int[10];type[type1];addr[0x76]*

View File

@@ -25,6 +25,7 @@ class SensorAny {
String _addr;
String _type;
String _val;
String _descr;
unsigned long prevMillis;
unsigned long difference;

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;