Upgrade and pin dependencies

This commit is contained in:
Djuri Baars 2024-06-28 17:56:08 +02:00
parent 24c3b46365
commit a9489c30f6
2 changed files with 193 additions and 193 deletions

View File

@ -32,10 +32,10 @@ build_unflags =
-fno-exceptions -fno-exceptions
lib_deps = lib_deps =
https://github.com/joltwallet/esp_littlefs.git https://github.com/joltwallet/esp_littlefs.git
bblanchon/ArduinoJson@^7.0.4 bblanchon/ArduinoJson@^7.1.0
esphome/Improv@^1.2.3 esphome/Improv@^1.2.3
mathieucarbou/ESP Async WebServer mathieucarbou/ESP Async WebServer@2.10.8
adafruit/Adafruit BusIO@^1.16.0 adafruit/Adafruit BusIO@^1.16.1
adafruit/Adafruit MCP23017 Arduino Library@^2.3.2 adafruit/Adafruit MCP23017 Arduino Library@^2.3.2
adafruit/Adafruit NeoPixel@^1.12.2 adafruit/Adafruit NeoPixel@^1.12.2
https://github.com/dsbaars/universal_pin https://github.com/dsbaars/universal_pin

View File

@ -348,7 +348,7 @@ void onApiShowScreen(AsyncWebServerRequest *request)
{ {
if (request->hasParam("s")) if (request->hasParam("s"))
{ {
AsyncWebParameter *p = request->getParam("s"); const AsyncWebParameter *p = request->getParam("s");
uint currentScreen = p->value().toInt(); uint currentScreen = p->value().toInt();
setCurrentScreen(currentScreen); setCurrentScreen(currentScreen);
} }
@ -359,7 +359,7 @@ void onApiShowText(AsyncWebServerRequest *request)
{ {
if (request->hasParam("t")) if (request->hasParam("t"))
{ {
AsyncWebParameter *p = request->getParam("t"); const AsyncWebParameter *p = request->getParam("t");
String t = p->value(); String t = p->value();
t.toUpperCase(); // This is needed as long as lowercase letters are glitchy t.toUpperCase(); // This is needed as long as lowercase letters are glitchy
@ -629,7 +629,7 @@ bool processEpdColorSettings(AsyncWebServerRequest *request)
bool settingsChanged = false; bool settingsChanged = false;
if (request->hasParam("fgColor", true)) if (request->hasParam("fgColor", true))
{ {
AsyncWebParameter *fgColor = request->getParam("fgColor", true); const AsyncWebParameter *fgColor = request->getParam("fgColor", true);
preferences.putUInt("fgColor", strtol(fgColor->value().c_str(), NULL, 16)); preferences.putUInt("fgColor", strtol(fgColor->value().c_str(), NULL, 16));
setFgColor(int(strtol(fgColor->value().c_str(), NULL, 16))); setFgColor(int(strtol(fgColor->value().c_str(), NULL, 16)));
// Serial.print(F("Setting foreground color to ")); // Serial.print(F("Setting foreground color to "));
@ -638,7 +638,7 @@ bool processEpdColorSettings(AsyncWebServerRequest *request)
} }
if (request->hasParam("bgColor", true)) if (request->hasParam("bgColor", true))
{ {
AsyncWebParameter *bgColor = request->getParam("bgColor", true); const AsyncWebParameter *bgColor = request->getParam("bgColor", true);
preferences.putUInt("bgColor", strtol(bgColor->value().c_str(), NULL, 16)); preferences.putUInt("bgColor", strtol(bgColor->value().c_str(), NULL, 16));
setBgColor(int(strtol(bgColor->value().c_str(), NULL, 16))); setBgColor(int(strtol(bgColor->value().c_str(), NULL, 16)));
@ -652,226 +652,226 @@ bool processEpdColorSettings(AsyncWebServerRequest *request)
void onApiSettingsPost(AsyncWebServerRequest *request) void onApiSettingsPost(AsyncWebServerRequest *request)
{ {
bool settingsChanged = false; // bool settingsChanged = false;
settingsChanged = processEpdColorSettings(request); // settingsChanged = processEpdColorSettings(request);
int headers = request->headers(); // int headers = request->headers();
int i; // int i;
for (i = 0; i < headers; i++) // for (i = 0; i < headers; i++)
{ // {
AsyncWebHeader *h = request->getHeader(i); // AsyncWebHeader *h = request->getHeader(i);
Serial.printf("HEADER[%s]: %s\n", h->name().c_str(), h->value().c_str()); // Serial.printf("HEADER[%s]: %s\n", h->name().c_str(), h->value().c_str());
} // }
int params = request->params(); // int params = request->params();
for (int i = 0; i < params; i++) // for (int i = 0; i < params; i++)
{ // {
AsyncWebParameter *p = request->getParam(i); // const AsyncWebParameter *p = request->getParam(i);
if (p->isFile()) // if (p->isFile())
{ // p->isPost() is also true // { // p->isPost() is also true
Serial.printf("FILE[%s]: %s, size: %u\n", p->name().c_str(), // Serial.printf("FILE[%s]: %s, size: %u\n", p->name().c_str(),
p->value().c_str(), p->size()); // p->value().c_str(), p->size());
} // }
else if (p->isPost()) // else if (p->isPost())
{ // {
Serial.printf("POST[%s]: %s\n", p->name().c_str(), p->value().c_str()); // Serial.printf("POST[%s]: %s\n", p->name().c_str(), p->value().c_str());
} // }
else // else
{ // {
Serial.printf("GET[%s]: %s\n", p->name().c_str(), p->value().c_str()); // Serial.printf("GET[%s]: %s\n", p->name().c_str(), p->value().c_str());
} // }
} // }
if (request->hasParam("fetchEurPrice", true)) // if (request->hasParam("fetchEurPrice", true))
{ // {
AsyncWebParameter *fetchEurPrice = request->getParam("fetchEurPrice", true); // const AsyncWebParameter *fetchEurPrice = request->getParam("fetchEurPrice", true);
preferences.putBool("fetchEurPrice", fetchEurPrice->value().toInt()); // preferences.putBool("fetchEurPrice", fetchEurPrice->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
else // else
{ // {
preferences.putBool("fetchEurPrice", 0); // preferences.putBool("fetchEurPrice", 0);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("ledTestOnPower", true)) // if (request->hasParam("ledTestOnPower", true))
{ // {
AsyncWebParameter *ledTestOnPower = // const AsyncWebParameter *ledTestOnPower =
request->getParam("ledTestOnPower", true); // request->getParam("ledTestOnPower", true);
preferences.putBool("ledTestOnPower", ledTestOnPower->value().toInt()); // preferences.putBool("ledTestOnPower", ledTestOnPower->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
else // else
{ // {
preferences.putBool("ledTestOnPower", 0); // preferences.putBool("ledTestOnPower", 0);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("ledFlashOnUpd", true)) // if (request->hasParam("ledFlashOnUpd", true))
{ // {
AsyncWebParameter *ledFlashOnUpdate = // const AsyncWebParameter *ledFlashOnUpdate =
request->getParam("ledFlashOnUpd", true); // request->getParam("ledFlashOnUpd", true);
preferences.putBool("ledFlashOnUpd", ledFlashOnUpdate->value().toInt()); // preferences.putBool("ledFlashOnUpd", ledFlashOnUpdate->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
else // else
{ // {
preferences.putBool("ledFlashOnUpd", 0); // preferences.putBool("ledFlashOnUpd", 0);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("mdnsEnabled", true)) // if (request->hasParam("mdnsEnabled", true))
{ // {
AsyncWebParameter *mdnsEnabled = request->getParam("mdnsEnabled", true); // const AsyncWebParameter *mdnsEnabled = request->getParam("mdnsEnabled", true);
preferences.putBool("mdnsEnabled", mdnsEnabled->value().toInt()); // preferences.putBool("mdnsEnabled", mdnsEnabled->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
else // else
{ // {
preferences.putBool("mdnsEnabled", 0); // preferences.putBool("mdnsEnabled", 0);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("otaEnabled", true)) // if (request->hasParam("otaEnabled", true))
{ // {
AsyncWebParameter *otaEnabled = request->getParam("otaEnabled", true); // const AsyncWebParameter *otaEnabled = request->getParam("otaEnabled", true);
preferences.putBool("otaEnabled", otaEnabled->value().toInt()); // preferences.putBool("otaEnabled", otaEnabled->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
else // else
{ // {
preferences.putBool("otaEnabled", 0); // preferences.putBool("otaEnabled", 0);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("stealFocus", false)) // if (request->hasParam("stealFocus", false))
{ // {
AsyncWebParameter *stealFocusOnBlock = // const AsyncWebParameter *stealFocusOnBlock =
request->getParam("stealFocus", false); // request->getParam("stealFocus", false);
preferences.putBool("stealFocus", stealFocusOnBlock->value().toInt()); // preferences.putBool("stealFocus", stealFocusOnBlock->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
else // else
{ // {
preferences.putBool("stealFocus", 0); // preferences.putBool("stealFocus", 0);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("mcapBigChar", true)) // if (request->hasParam("mcapBigChar", true))
{ // {
AsyncWebParameter *mcapBigChar = request->getParam("mcapBigChar", true); // const AsyncWebParameter *mcapBigChar = request->getParam("mcapBigChar", true);
preferences.putBool("mcapBigChar", mcapBigChar->value().toInt()); // preferences.putBool("mcapBigChar", mcapBigChar->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
else // else
{ // {
preferences.putBool("mcapBigChar", 0); // preferences.putBool("mcapBigChar", 0);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("mempoolInstance", true)) // if (request->hasParam("mempoolInstance", true))
{ // {
AsyncWebParameter *mempoolInstance = // const AsyncWebParameter *mempoolInstance =
request->getParam("mempoolInstance", true); // request->getParam("mempoolInstance", true);
preferences.putString("mempoolInstance", mempoolInstance->value().c_str()); // preferences.putString("mempoolInstance", mempoolInstance->value().c_str());
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("hostnamePrefix", true)) // if (request->hasParam("hostnamePrefix", true))
{ // {
AsyncWebParameter *hostnamePrefix = // const AsyncWebParameter *hostnamePrefix =
request->getParam("hostnamePrefix", true); // request->getParam("hostnamePrefix", true);
preferences.putString("hostnamePrefix", hostnamePrefix->value().c_str()); // preferences.putString("hostnamePrefix", hostnamePrefix->value().c_str());
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("ledBrightness", true)) // if (request->hasParam("ledBrightness", true))
{ // {
AsyncWebParameter *ledBrightness = request->getParam("ledBrightness", true); // const AsyncWebParameter *ledBrightness = request->getParam("ledBrightness", true);
preferences.putUInt("ledBrightness", ledBrightness->value().toInt()); // preferences.putUInt("ledBrightness", ledBrightness->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("fullRefreshMin", true)) // if (request->hasParam("fullRefreshMin", true))
{ // {
AsyncWebParameter *fullRefreshMin = // const AsyncWebParameter *fullRefreshMin =
request->getParam("fullRefreshMin", true); // request->getParam("fullRefreshMin", true);
preferences.putUInt("fullRefreshMin", fullRefreshMin->value().toInt()); // preferences.putUInt("fullRefreshMin", fullRefreshMin->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("wpTimeout", true)) // if (request->hasParam("wpTimeout", true))
{ // {
AsyncWebParameter *wpTimeout = request->getParam("wpTimeout", true); // const AsyncWebParameter *wpTimeout = request->getParam("wpTimeout", true);
preferences.putUInt("wpTimeout", wpTimeout->value().toInt()); // preferences.putUInt("wpTimeout", wpTimeout->value().toInt());
settingsChanged = true; // settingsChanged = true;
} // }
std::vector<std::string> screenNameMap = getScreenNameMap(); // std::vector<std::string> screenNameMap = getScreenNameMap();
if (request->hasParam("screens")) // if (request->hasParam("screens"))
{ // {
AsyncWebParameter *screenParam = request->getParam("screens", true); // const AsyncWebParameter *screenParam = request->getParam("screens", true);
Serial.printf(screenParam->value().c_str()); // Serial.printf(screenParam->value().c_str());
} // }
for (int i = 0; i < screenNameMap.size(); i++) // for (int i = 0; i < screenNameMap.size(); i++)
{ // {
String key = "screen[" + String(i) + "]"; // String key = "screen[" + String(i) + "]";
String prefKey = "screen" + String(i) + "Visible"; // String prefKey = "screen" + String(i) + "Visible";
bool visible = false; // bool visible = false;
if (request->hasParam(key, true)) // if (request->hasParam(key, true))
{ // {
AsyncWebParameter *screenParam = request->getParam(key, true); // const AsyncWebParameter *screenParam = request->getParam(key, true);
visible = screenParam->value().toInt(); // visible = screenParam->value().toInt();
} // }
preferences.putBool(prefKey.c_str(), visible); // preferences.putBool(prefKey.c_str(), visible);
} // }
if (request->hasParam("tzOffset", true)) // if (request->hasParam("tzOffset", true))
{ // {
AsyncWebParameter *p = request->getParam("tzOffset", true); // const AsyncWebParameter *p = request->getParam("tzOffset", true);
int tzOffsetSeconds = p->value().toInt() * 60; // int tzOffsetSeconds = p->value().toInt() * 60;
preferences.putInt("gmtOffset", tzOffsetSeconds); // preferences.putInt("gmtOffset", tzOffsetSeconds);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("minSecPriceUpd", true)) // if (request->hasParam("minSecPriceUpd", true))
{ // {
AsyncWebParameter *p = request->getParam("minSecPriceUpd", true); // const AsyncWebParameter *p = request->getParam("minSecPriceUpd", true);
int minSecPriceUpd = p->value().toInt(); // int minSecPriceUpd = p->value().toInt();
preferences.putUInt("minSecPriceUpd", minSecPriceUpd); // preferences.putUInt("minSecPriceUpd", minSecPriceUpd);
settingsChanged = true; // settingsChanged = true;
} // }
if (request->hasParam("timePerScreen", true)) // if (request->hasParam("timePerScreen", true))
{ // {
AsyncWebParameter *p = request->getParam("timePerScreen", true); // const AsyncWebParameter *p = request->getParam("timePerScreen", true);
uint timerSeconds = p->value().toInt() * 60; // uint timerSeconds = p->value().toInt() * 60;
preferences.putUInt("timerSeconds", timerSeconds); // preferences.putUInt("timerSeconds", timerSeconds);
settingsChanged = true; // settingsChanged = true;
} // }
request->send(200); // request->send(200);
if (settingsChanged) // if (settingsChanged)
{ // {
queueLedEffect(LED_FLASH_SUCCESS); // queueLedEffect(LED_FLASH_SUCCESS);
} // }
} }
void onApiSystemStatus(AsyncWebServerRequest *request) void onApiSystemStatus(AsyncWebServerRequest *request)
@ -900,7 +900,7 @@ void onApiSetWifiTxPower(AsyncWebServerRequest *request)
{ {
if (request->hasParam("txPower")) if (request->hasParam("txPower"))
{ {
AsyncWebParameter *txPowerParam = request->getParam("txPower"); const AsyncWebParameter *txPowerParam = request->getParam("txPower");
int txPower = txPowerParam->value().toInt(); int txPower = txPowerParam->value().toInt();
if (static_cast<int>(wifi_power_t::WIFI_POWER_MINUS_1dBm) <= txPower && if (static_cast<int>(wifi_power_t::WIFI_POWER_MINUS_1dBm) <= txPower &&
txPower <= static_cast<int>(wifi_power_t::WIFI_POWER_19_5dBm)) txPower <= static_cast<int>(wifi_power_t::WIFI_POWER_19_5dBm))
@ -1076,7 +1076,7 @@ void onNotFound(AsyncWebServerRequest *request)
// int params = request->params(); // int params = request->params();
// for (int i = 0; i < params; i++) // for (int i = 0; i < params; i++)
// { // {
// AsyncWebParameter *p = request->getParam(i); // const AsyncWebParameter *p = request->getParam(i);
// if (p->isFile()) // if (p->isFile())
// { // p->isPost() is also true // { // p->isPost() is also true
// Serial.printf("NotFound FILE[%s]: %s, size: %u\n", // Serial.printf("NotFound FILE[%s]: %s, size: %u\n",