powermeter refactor: avoid reboot on settings change

the current power meter provider will be de-initialized, and a new
instance will be initialized with the new settings.
This commit is contained in:
Bernhard Kirchen 2024-05-08 13:09:05 +02:00
parent 33683d26c8
commit 5cd6334880

View File

@ -226,12 +226,7 @@ void WebApiPowerMeterClass::onAdminPost(AsyncWebServerRequest* request)
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
// reboot requiered as per https://github.com/helgeerbe/OpenDTU-OnBattery/issues/565#issuecomment-1872552559
yield();
delay(1000);
yield();
ESP.restart();
PowerMeter.updateSettings();
}
void WebApiPowerMeterClass::onTestHttpRequest(AsyncWebServerRequest* request)