diff --git a/data_esp/items/items.txt b/data_esp/items/items.txt index e5b8e2ac..5e43e747 100644 --- a/data_esp/items/items.txt +++ b/data_esp/items/items.txt @@ -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]* \ No newline at end of file diff --git a/include/items/vSensorAny.h b/include/items/vSensorAny.h index 6155c4a2..4083a875 100644 --- a/include/items/vSensorAny.h +++ b/include/items/vSensorAny.h @@ -25,6 +25,7 @@ class SensorAny { String _addr; String _type; String _val; + String _descr; unsigned long prevMillis; unsigned long difference; diff --git a/src/YourSensor.cpp b/src/YourSensor.cpp index 4295b33e..86ab858e 100644 --- a/src/YourSensor.cpp +++ b/src/YourSensor.cpp @@ -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; } diff --git a/src/items/vSensorAny.cpp b/src/items/vSensorAny.cpp index 621535bd..0f4bbc5f 100644 --- a/src/items/vSensorAny.cpp +++ b/src/items/vSensorAny.cpp @@ -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;