mqttDisconnect() before 'restart' or 'otaEnd'

This commit is contained in:
Patrick Haßel 2024-04-15 14:11:35 +02:00
parent be49cd9123
commit b298f84271
2 changed files with 2 additions and 0 deletions

View File

@ -113,6 +113,7 @@ void _reboot() {
info("Rebooting..."); info("Rebooting...");
delay(500); delay(500);
yield(); yield();
mqttDisconnect();
ESP.restart(); ESP.restart();
} }

View File

@ -93,6 +93,7 @@ void otaSetup() {
}); });
ArduinoOTA.onEnd([] { ArduinoOTA.onEnd([] {
info("OTA Complete!"); info("OTA Complete!");
mqttDisconnect();
}); });
ArduinoOTA.onError([](ota_error_t e) { ArduinoOTA.onError([](ota_error_t e) {
const char *name; const char *name;