Fix bitcoin halving countdown and add EUR fetch price

This commit is contained in:
Djuri 2023-11-13 17:14:11 +01:00
parent 3f49b3ef4e
commit 6dfc15832b
9 changed files with 72 additions and 19 deletions

View file

@ -244,7 +244,7 @@ void onApiSettingsGet(AsyncWebServerRequest *request)
root["mcapBigChar"] = preferences.getBool("mcapBigChar", true);
root["mdnsEnabled"] = preferences.getBool("mdnsEnabled", true);
root["otaEnabled"] = preferences.getBool("otaEnabled", true);
root["fetchEurPrice"] = preferences.getBool("fetchEurPrice", false);
root["hostname"] = getMyHostname();
root["ip"] = WiFi.localIP();
@ -305,6 +305,19 @@ void onApiSettingsPost(AsyncWebServerRequest *request)
settingsChanged = processEpdColorSettings(request);
if (request->hasParam("fetchEurPrice", true))
{
AsyncWebParameter *fetchEurPrice = request->getParam("fetchEurPrice", true);
preferences.putBool("fetchEurPrice", fetchEurPrice->value().toInt());
settingsChanged = true;
}
else
{
preferences.putBool("fetchEurPrice", 0);
settingsChanged = true;
}
if (request->hasParam("ledTestOnPower", true))
{
AsyncWebParameter *ledTestOnPower = request->getParam("ledTestOnPower", true);