Updates notification (#3119)

Hi,

Like some default modules, I propose to send an `UPDATES` notification
in an array with the git information of these modules

This allows developers to create their own auto-update system (which
I've been using in my case since 3 years, with automatic things)

Of course, for security reasons `MagicMirror` is excluded

---------

Co-authored-by: bugsounet <bugsounet@bugsounet.fr>
This commit is contained in:
Bugsounet - Cédric
2023-06-08 22:41:48 +02:00
committed by GitHub
parent b7371538bc
commit e985e99036
4 changed files with 36 additions and 6 deletions

View File

@@ -8,7 +8,8 @@ Module.register("updatenotification", {
defaults: {
updateInterval: 10 * 60 * 1000, // every 10 minutes
refreshInterval: 24 * 60 * 60 * 1000, // one day
ignoreModules: []
ignoreModules: [],
sendUpdatesNotifications: false
},
suspended: false,
@@ -40,8 +41,13 @@ Module.register("updatenotification", {
},
socketNotificationReceived(notification, payload) {
if (notification === "STATUS") {
this.updateUI(payload);
switch (notification) {
case "STATUS":
this.updateUI(payload);
break;
case "UPDATES":
this.sendNotification("UPDATES", payload);
break;
}
},