diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 8ea231a..7442fc5 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -631,10 +631,18 @@ bool digGroup (aJsonObject *itemArr, itemCmd *cmd, char* subItem) { //is Group aJsonObject * itemSubArray = aJson.getArrayItem(nextItem,1); short res = digGroup(itemSubArray,cmd,subItem); - if (!cmd && res) return true; //Not execution, just activity check. If any channel is active - return true + if (!cmd && res) + { + configLocked--; + return true; //Not execution, just activity check. If any channel is active - return true + } } else // Normal channel - if (!cmd && it.isValid() && it.isActive()) return true; //Not execution, just activity check. If any channel is active - return true + if (!cmd && it.isValid() && it.isActive()) + { + configLocked--; + return true; //Not execution, just activity check. If any channel is active - return true + } } } i = i->next; diff --git a/lighthub/main.cpp b/lighthub/main.cpp index cba33e7..ecebb73 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -191,7 +191,8 @@ void cleanConf() { if (!root) return; debugSerial<child; @@ -371,7 +378,11 @@ if (element && element->type == aJson_String) return element->valuestring; return NULL; } - + #if defined(ARDUINO_ARCH_ESP32) || defined(ESP8266) + #define flashStorage InternalStorage + #else +InternalStorageClass flashStorage(EEPROM_offsetJSON); +#endif void setupOTA(void) { @@ -379,7 +390,7 @@ void setupOTA(void) //if (OTA_initialized) return; // ArduinoOTA.end(); // start the OTEthernet library with internal (flash) based storage - ArduinoOTA.begin(Ethernet.localIP(), "Lighthub", "password", InternalStorage); + ArduinoOTA.begin(Ethernet.localIP(), "Lighthub", "password", flashStorage); infoSerial<= 3) port = aJson.getArrayItem(mqttArr, 2)->valueint; @@ -1159,6 +1170,7 @@ int loadConfigFromEEPROM() infoSerial<