diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/usermod_temperature.h index f85d0c32..a21d8368 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/usermod_temperature.h @@ -238,8 +238,9 @@ class UsermodTemperature : public Usermod { // we look for JSON object: {"Temperature": {"pin": 0, "degC": true}} JsonObject top = root[FPSTR(_name)]; int8_t newTemperaturePin = temperaturePin; + if (top.isNull()) return; - if (!top.isNull() && top["pin"] != nullptr) { + if (top["pin"] != nullptr) { if (top[FPSTR(_enabled)].is()) { disabled = !top[FPSTR(_enabled)].as(); } else { @@ -247,6 +248,9 @@ class UsermodTemperature : public Usermod { disabled = (bool)(str=="off"); // off is guaranteed to be present } newTemperaturePin = min(39,max(-1,top["pin"].as())); + } + + if (top["degC"] != nullptr) { if (top["degC"].is()) { // reading from cfg.json degC = top["degC"].as(); @@ -255,7 +259,13 @@ class UsermodTemperature : public Usermod { String str = top["degC"]; // checkbox -> off or on degC = (bool)(str!="off"); // off is guaranteed to be present } + } + + if (top[FPSTR(_readInterval)] != nullptr) { readingInterval = min(120,max(10,top[FPSTR(_readInterval)].as())) * 1000; // convert to ms + } + + if (top[FPSTR(_parasite)] != nullptr) { if (top[FPSTR(_parasite)].is()) { // reading from cfg.json parasite = top[FPSTR(_parasite)].as(); @@ -264,8 +274,6 @@ class UsermodTemperature : public Usermod { String str = top[FPSTR(_parasite)]; // checkbox -> off or on parasite = (bool)(str!="off"); // off is guaranteed to be present } - } else { - DEBUG_PRINTLN(F("No config found. (Using defaults.)")); } if (!initDone) { diff --git a/wled00/ir.cpp b/wled00/ir.cpp index b48d48b8..8f639569 100644 --- a/wled00/ir.cpp +++ b/wled00/ir.cpp @@ -570,7 +570,7 @@ void decodeIRJson(uint32_t code) JsonObject fdo; JsonObject jsonCmdObj; - sprintf_P(objKey, PSTR("\"0x%lX\":"), code); + sprintf_P(objKey, PSTR("\"0x%lX\":"), (unsigned long)code); errorFlag = readObjectFromFile("/ir.json", objKey, &irDoc) ? ERR_NONE : ERR_FS_PLOAD; fdo = irDoc.as(); @@ -643,7 +643,7 @@ void handleIR() { if (results.value != 0) // only print results if anything is received ( != 0 ) { - DEBUG_PRINTF("IR recv: 0x%lX\n", (uint32_t)results.value); + DEBUG_PRINTF("IR recv: 0x%lX\n", (unsigned long)results.value); } decodeIR(results.value); irrecv->resume(); diff --git a/wled00/wled.h b/wled00/wled.h index 227835a4..fcdbadb7 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2105261 +#define VERSION 2105262 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG