Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Thanks to: @bugsounet, @dkallen78, @jargordon, @khassel, @KristjanESPERANTO, @Ma

### Added

- [compliments] Added config for refreshing the remote file on an interval (default - no refresh)
- [compliments] Added support for cron type date/time format entries mm hh DD MM dow (minutes/hours/days/months and day of week) see https://crontab.cronhub.io for construction (#3481)
- [core] Check config at every start of MagicMirror² (#3450)
- [core] Add spelling check (cspell): `npm run test:spelling` and handle spelling issues (#3544)
Expand Down
8 changes: 8 additions & 0 deletions modules/default/compliments/compliments.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Module.register("compliments", {
},
updateInterval: 30000,
remoteFile: null,
remoteFileRefreshInterval: null,
fadeSpeed: 4000,
morningStartTime: 3,
morningEndTime: 12,
Expand Down Expand Up @@ -41,6 +42,13 @@ Module.register("compliments", {
const response = await this.loadComplimentFile();
this.config.compliments = JSON.parse(response);
this.updateDom();
if (this.config.remoteFileRefreshInterval != null) {
this.remoteFileRefreshFunc = setInterval(() => {
const response = await this.loadComplimentFile();
this.config.compliments = JSON.parse(response);
this.lastIndexUsed = -1;
}, this.config.remoteFileRefreshInterval)
}
}
let minute_sync_delay = 1;
// loop thru all the configured when events
Expand Down