Skip to content

Commit 056e261

Browse files
authored
1 parent b9b9c1b commit 056e261

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/framework/WiFiSettingsService.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ WiFiSettingsService::WiFiSettingsService(AsyncWebServer* server, FS* fs, Securit
44
_httpEndpoint(WiFiSettings::read, WiFiSettings::update, this, server, WIFI_SETTINGS_SERVICE_PATH, securityManager),
55
_fsPersistence(WiFiSettings::read, WiFiSettings::update, this, fs, WIFI_SETTINGS_FILE),
66
_lastConnectionAttempt(0) {
7+
addUpdateHandler([&](const String& originId) { reconfigureWiFiConnection(); }, false);
8+
}
9+
10+
void WiFiSettingsService::begin() {
711
// We want the device to come up in opmode=0 (WIFI_OFF), when erasing the flash this is not the default.
812
// If needed, we save opmode=0 before disabling persistence so the device boots with WiFi disabled in the future.
913
if (WiFi.getMode() != WIFI_OFF) {
@@ -27,10 +31,6 @@ WiFiSettingsService::WiFiSettingsService(AsyncWebServer* server, FS* fs, Securit
2731
std::bind(&WiFiSettingsService::onStationModeDisconnected, this, std::placeholders::_1));
2832
#endif
2933

30-
addUpdateHandler([&](const String& originId) { reconfigureWiFiConnection(); }, false);
31-
}
32-
33-
void WiFiSettingsService::begin() {
3434
_fsPersistence.readFromFS();
3535
reconfigureWiFiConnection();
3636
}

0 commit comments

Comments
 (0)