Skip to content

Commit

Permalink
Merge pull request #88 from shmulyeng/master
Browse files Browse the repository at this point in the history
added notification to reload image list
  • Loading branch information
darickc committed Dec 31, 2020
2 parents e018312 + 602cd9f commit 663ba52
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MMM-BackgroundSlideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ Module.register('MMM-BackgroundSlideshow', {
notificationReceived: function (notification, payload, sender) {
if (sender) {
// Log.log(this.name + " received a module notification: " + notification + " from sender: " + sender.name);
if (notification === 'BACKGROUNDSLIDESHOW_IMAGE_UPDATE') {
if (notification === 'BACKGROUNDSLIDESHOW_UPDATE_IMAGE_LIST') {
this.imageIndex = -1;
this.updateImageList();
this.updateImage();
} else if (notification === 'BACKGROUNDSLIDESHOW_IMAGE_UPDATE') {
Log.log('MMM-BackgroundSlideshow: Changing Background');
this.suspend();
this.updateImage();
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ The following notifications can be used:
</tr>
<thead>
<tbody>
<tr>
<td><code>BACKGROUNDSLIDESHOW_UPDATE_IMAGE_LIST</code></td>
<td>Reload images list and start slideshow from first image. Works best when sorted by modified date descending.<br>
</td>
</tr>
<tr>
<td><code>BACKGROUNDSLIDESHOW_NEXT</code></td>
<td>Change to the next image, restart the timer for image changes only if already running<br>
Expand Down

0 comments on commit 663ba52

Please sign in to comment.