Добавляем релоад конфигурации при нажатии соответсвующей кнопки в интерфейсе

This commit is contained in:
2022-02-14 22:20:35 +03:00
parent c144a3ae1e
commit cafac8b76e
4 changed files with 12 additions and 0 deletions

View File

@@ -29,4 +29,12 @@ void configure(String path) {
}
}
file.close();
}
void clearConfigure() {
Serial.printf("Start clearing config\n");
for (unsigned int i = 0; i < IoTItems.size(); i++) {
if (IoTItems[i]) delete IoTItems[i];
}
IoTItems.clear();
}

View File

@@ -71,6 +71,8 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
//**сохранение**//
if (headerStr == "/gifnoc|") {
writeFileUint8tByFrames("config.json", payload, length, headerLenth, 256);
clearConfigure();
configure("/config.json");
}
// page connection===================================================================
//**отправка**//