Skip to content
Open
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
12 changes: 11 additions & 1 deletion MMM-BackgroundSlideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ Module.register('MMM-BackgroundSlideshow', {

// generic notification handler
notificationReceived: function (notification, payload, sender) {

//Quick and dirty fix to redirect the notification
this.socketNotificationReceived(notification,payload);
},

updateImageListWithArray: function (urls) {
Expand Down Expand Up @@ -261,6 +262,15 @@ Module.register('MMM-BackgroundSlideshow', {
} else if (notification === 'BACKGROUNDSLIDESHOW_PAUSE') {
// Stop timer.
this.suspend();
} else if (notification === 'BACKGROUNDSLIDESHOW_CHANGE_FOLDER') {
if (payload && payload.folder){
Log.log("MMM-Backgroundslideshow: Changing folder to: "+ payload.folder);
this.config.imagePaths[0] = payload.folder;
//this.imageIndex = -1;
this.updateImageList();
} else {
Log.log("MMM-Backgroundslideshow: Missing folder");
}
} else if (notification === 'BACKGROUNDSLIDESHOW_URL') {
if (payload && payload.url) {
// Stop timer.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ The following notifications can be used:
<br>Example payload: {urls:['url_to_image', 'url_to_image']}
</td>
</tr>
<tr>
<td><code>BACKGROUNDSLIDESHOW_CHANGE_FOLDER</code></td>
<td>Pass the new folder path via notification.
<br>Example payload: {folder:modules/MMM-BackgroundSlideshow/exampleImages/subfolder}
</td>
</tr>
</table>

## Configuration options
Expand Down