Optimization

This commit is contained in:
Dmitry Borisenko
2020-10-20 22:55:45 +03:00
parent 6064b9eac9
commit a5171f1178
25 changed files with 69 additions and 116 deletions

View File

@@ -1,7 +1,6 @@
#include "ItemsCmd.h"
#include "items/InputClass.h"
//==========================================Модуль ввода времени============================================
//input-time time1 inputTime Ввод Введите.время 4 st[10-00-00]
//==========================================================================================================
InputClass myInputTime;
void inputTime() {
@@ -21,8 +20,9 @@ void inputTimeSet() {
void handle_time_init() {
ts.add(
TIME, 1000, [&](void *) {
jsonWriteStr(configLiveJson, "time", timeNow->getTime());
jsonWriteStr(configLiveJson, "timenow", timeNow->getTimeJson());
//jsonWriteStr(configLiveJson, "time", timeNow->getTime());
//jsonWriteStr(configLiveJson, "timenow", timeNow->getTimeJson());
jsonWriteStr(configLiveJson, "timenow", timeNow->getTime());
eventGen("timenow", "");
},
nullptr, true);

View File

@@ -8,7 +8,7 @@ void analogAdc() {
mySensorAnalog.update();
String key = mySensorAnalog.gkey();
sCmd.addCommand(key.c_str(), analogReading);
sensorReadingMap += key + ",";
sensorReadingMap10sec += key + ",";
mySensorAnalog.SensorAnalogInit();
mySensorAnalog.clear();
}

View File

@@ -7,16 +7,14 @@ void sysUptime() {
myLineParsing.update();
String key = myLineParsing.gkey();
sCmd.addCommand(key.c_str(), uptimeReading);
sensorReadingMap += key + ",";
sensorReadingMap60sec += key + ",";
myLineParsing.clear();
}
void uptimeReading() {
String key = sCmd.order();
eventGen(key, "");
String uptime = timeNow->getUptime();
uptime.replace(":", "-");
jsonWriteStr(configLiveJson, key, uptime);
publishStatus(key, uptime);
Serial.println("I sensor '" + key + "' data: " + uptime);
SerialPrint("I", "Sensor", "'" + key + "' data: " + uptime);
}