Added Updater to automatically perform OTA updates without user interaction.
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include "config.h"
|
||||
#include "playlist.h"
|
||||
#include "http_server.h"
|
||||
#include "updater.h"
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
Controller::Controller(Player* p, PlaylistManager* playlist_manager) {
|
||||
@ -50,6 +51,14 @@ void Controller::loop() {
|
||||
process_message(_cmd_queue);
|
||||
_cmd_queue = "";
|
||||
}
|
||||
|
||||
#ifdef OTA_UPDATE_URL
|
||||
if (!player->is_playing() && _last_update_check_at<millis() && _last_update_check_at + OTA_CHECK_INTERVAL < millis()) {
|
||||
Updater::run();
|
||||
} else {
|
||||
_last_update_check_at = millis();
|
||||
}
|
||||
#endif
|
||||
TRACE("Controller::loop() done.\n");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user