diff --git a/platformio.ini b/platformio.ini index c45df3d..9a68b05 100644 --- a/platformio.ini +++ b/platformio.ini @@ -63,7 +63,7 @@ lib_deps = mathieucarbou/AsyncTCP @ 3.2.14 ; https://github.com/mathieucarbou/AsyncTCPSock/archive/refs/tags/v1.0.3-dev.zip mathieucarbou/ESPAsyncWebServer @ 3.3.22 - mathieucarbou/MycilaConfig @ 5.0.0 + mathieucarbou/MycilaConfig @ 6.0.1 mathieucarbou/MycilaDS18 @ 4.1.0 mathieucarbou/MycilaESPConnect @ 6.1.1 mathieucarbou/MycilaEasyDisplay @ 3.0.2 diff --git a/src/init/REST.cpp b/src/init/REST.cpp index 3452f66..2ec08b6 100644 --- a/src/init/REST.cpp +++ b/src/init/REST.cpp @@ -9,6 +9,7 @@ #include #include +#include Mycila::Task initRestApiTask("Init REST API", [](void* params) { logger.info(TAG, "Initializing REST API"); @@ -168,12 +169,12 @@ Mycila::Task initRestApiTask("Init REST API", [](void* params) { webServer .on("/api/config", HTTP_POST, [](AsyncWebServerRequest* request) { - std::map settings; + std::map settings; for (size_t i = 0, max = request->params(); i < max; i++) { const AsyncWebParameter* p = request->getParam(i); if (p->isPost() && !p->isFile()) { const char* keyRef = config.keyRef(p->name().c_str()); - settings[keyRef] = p->value(); + settings[keyRef] = p->value().c_str(); } } request->send(200);