mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 01:09:51 +03:00
fixes to restart
This commit is contained in:
@@ -1673,8 +1673,8 @@ void EMSESP::loop() {
|
||||
|
||||
// force a query on the EMS devices to fetch latest data at a set interval (1 min)
|
||||
scheduled_fetch_values();
|
||||
} else {
|
||||
emsesp::EMSESP::system_.uploadFirmwareURL(); // start an upload from a URL. This is blocking.
|
||||
} else if (!system_.uploadFirmwareURL()) { // start an upload from a URL. This is blocking.
|
||||
system_.upload_status(false); // abort the upload
|
||||
}
|
||||
|
||||
uuid::loop();
|
||||
|
||||
@@ -1754,15 +1754,16 @@ bool System::command_format(const char * value, const int8_t id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// restart command - perform a hard reset
|
||||
// restart command - perform a hard reset (system reboot)
|
||||
bool System::command_restart(const char * value, const int8_t id) {
|
||||
if (id != 0) {
|
||||
if (id == 0) {
|
||||
// if it has an id then it's a web call and we need to queue the restart
|
||||
// default id is -1 when calling /api/system/restart directly for example
|
||||
LOG_INFO("Preparing to restart system");
|
||||
EMSESP::system_.restart_pending(true);
|
||||
return true;
|
||||
}
|
||||
LOG_INFO("Restarting system");
|
||||
LOG_INFO("Restarting system immediately");
|
||||
EMSESP::system_.restart_requested(true); // will be handled by the main loop
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user