новый веб 4.1.2

This commit is contained in:
Dmitry Borisenko
2022-03-02 00:43:43 +01:00
parent c3529d1a10
commit 9d956113b5
6 changed files with 13 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<title>IoT Manager 4.1.1</title>
<title>IoT Manager 4.1.2</title>
<link rel='icon' type='image/png' href='/favicon.ico'>
<link rel='stylesheet' href='/build/bundle.css'>

View File

@@ -16,5 +16,5 @@
"mqttPass": "hostel3333",
"serverip": "http://206.189.49.244:8081",
"log": 0,
"mqttin": 1
"mqttin": 0
}

View File

@@ -25,7 +25,7 @@ void globalVarsSync() {
String getParamsJson() {
String json;
serializeJson(*getLocalItemsAsJSON(), json);
serializeJson(*getLocalItemsAsJSON(), json); // Ilya, data: "1.00" (analog sensor, round set to 1, should be "1.0")
jsonWriteStr_(json, "params", "");
return json;
}

View File

@@ -71,7 +71,7 @@ void IoTItem::regEvent(String value, String consoleInfo = "") {
SerialPrint("i", F("<=MQTT"), "Broadcast event: " + json);
}
//========================================================================
publishStatusWs(_id, value);
publishStatusWs(_id, value); // Ilya, data: "1" (analog sensor, round set to 1, should be "1.0")
SerialPrint("i", "Sensor " + consoleInfo, "'" + _id + "' data: " + value + "'");
}
@@ -80,7 +80,7 @@ void IoTItem::regEvent(float regvalue, String consoleInfo = "") {
if (_plus) regvalue = regvalue + _multiply;
if (_round >= 0 && _round < 6) {
int sot = _round ? pow(10, (int)_round) : 1;
regvalue = round(regvalue*sot)/sot;
regvalue = round(regvalue * sot) / sot;
}
if (_map1 != _map2) regvalue = map(regvalue, _map1, _map2, _map3, _map4);
@@ -134,8 +134,10 @@ IoTItem* findIoTItem(String name) { // поиск элемента модуля
String getItemValue(String name) { // поиск плюс получение значения
IoTItem* tmp = findIoTItem(name);
if (tmp) return tmp->getValue();
else return "";
if (tmp)
return tmp->getValue();
else
return "";
}
StaticJsonDocument<JSON_BUFFER_SIZE> docForExport;