This commit is contained in:
e2002
2024-12-16 17:09:32 +03:00
parent 4da7118dd4
commit bdda7854b5
5 changed files with 7 additions and 4 deletions

View File

@@ -234,6 +234,9 @@ Work is in progress...
--- ---
## Version history ## Version history
### v0.9.373
- fixed the issue with displaying the settings page on fresh ESP modules after saving the weather key
#### v0.9.370 #### v0.9.370
- fixed the issue with saving settings on fresh ESP modules. - fixed the issue with saving settings on fresh ESP modules.

View File

@@ -286,7 +286,7 @@ template <class T> int Config::eepromRead(int ee, T& value) {
void Config::reset(){ void Config::reset(){
setDefaults(); setDefaults();
eepromWrite(EEPROM_START, store); eepromWrite(EEPROM_START, store);
delay(100); delay(500);
ESP.restart(); ESP.restart();
} }

View File

@@ -250,7 +250,7 @@ class Config {
if (strcmp(field, value) == 0 && !force) return; if (strcmp(field, value) == 0 && !force) return;
strlcpy(field, value, N); strlcpy(field, value, N);
size_t address = getAddr(field); size_t address = getAddr(field);
for (size_t i = 0; i < strlen(field); i++) EEPROM.write(address + i, field[i]); for (size_t i = 0; i <= strlen(field); i++) EEPROM.write(address + i, field[i]);
if(commit) if(commit)
EEPROM.commit(); EEPROM.commit();
} }

View File

@@ -840,7 +840,7 @@ void handleHTTPArgs(AsyncWebServerRequest * request) {
if (request->hasArg("next")) { player.next(); commandFound=true; } if (request->hasArg("next")) { player.next(); commandFound=true; }
if (request->hasArg("volm")) { player.stepVol(false); commandFound=true; } if (request->hasArg("volm")) { player.stepVol(false); commandFound=true; }
if (request->hasArg("volp")) { player.stepVol(true); commandFound=true; } if (request->hasArg("volp")) { player.stepVol(true); commandFound=true; }
if (request->hasArg("reset")) { config.reset(); commandFound=true; } if (request->hasArg("reset")) { request->redirect("/"); request->send(200); config.reset(); return; }
if (request->hasArg("trebble") && request->hasArg("middle") && request->hasArg("bass")) { if (request->hasArg("trebble") && request->hasArg("middle") && request->hasArg("bass")) {
AsyncWebParameter* pt = request->getParam("trebble", request->method() == HTTP_POST); AsyncWebParameter* pt = request->getParam("trebble", request->method() == HTTP_POST);
AsyncWebParameter* pm = request->getParam("middle", request->method() == HTTP_POST); AsyncWebParameter* pm = request->getParam("middle", request->method() == HTTP_POST);

View File

@@ -1,7 +1,7 @@
#ifndef options_h #ifndef options_h
#define options_h #define options_h
#define YOVERSION "0.9.370" #define YOVERSION "0.9.373"
/******************************************************* /*******************************************************
DO NOT EDIT THIS FILE. DO NOT EDIT THIS FILE.