This commit is contained in:
Dmitry Borisenko
2023-06-25 18:41:46 +02:00
parent 5d9deb8e95
commit 415fe9c5b3
12 changed files with 134 additions and 122 deletions

View File

@@ -238,6 +238,18 @@ int jsonReadInt(const String& json, String name, bool e) {
return doc[name].as<int>();
}
long int jsonReadLInt(const String& json, String name, bool e) {
DynamicJsonDocument doc(JSON_BUFFER_SIZE);
DeserializationError error = deserializeJson(doc, json);
if (error) {
if (e) {
SerialPrint("E", F("jsonRead"), error.f_str());
jsonErrorDetected();
}
}
return doc[name].as<long int>();
}
// depricated========================================================================
String jsonWriteStr(String& json, String name, String value, bool e) {
DynamicJsonDocument doc(JSON_BUFFER_SIZE);

View File

@@ -2,7 +2,7 @@
#include "Global.h"
#include "utils/StringUtils.h"
static const char* TIME_FORMAT PROGMEM = "%02d:%02d"; //:%02d";
static const char* TIME_FORMAT PROGMEM = "%02d:%02d:%02d";
static const char* TIME_FORMAT_WITH_DAYS PROGMEM = "%dd %02d:%02d";
const String prettySeconds(unsigned long time_s) {