gracefully close mqtt on restart

This commit is contained in:
proddy
2025-01-14 19:03:30 +01:00
parent 24fba8b382
commit 64a2f5eb11
2 changed files with 7 additions and 0 deletions

View File

@@ -303,6 +303,7 @@ void System::system_restart(const char * partitionname) {
store_nvs_values(); // save any NVS values
Shell::loop_all(); // flush log to output
Mqtt::disconnect(); // gracefully disconnect MQTT, needed for QOS1
delay(1000); // wait 1 second
ESP.restart();
#else