-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMMM-Pages-Screencast.js
More file actions
42 lines (38 loc) · 1.01 KB
/
Copy pathMMM-Pages-Screencast.js
File metadata and controls
42 lines (38 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ################################################################ \\
// # MMM-Pages-Screencast # \\
// # Interface between MMM-Pages and MMM-Screencast # \\
// ################################################################ \\
Module.register("MMM-Pages-Screencast", {
defaults: {
homePage: 0,
castPage: 1,
},
start: function () {
this.logMessage('Started.');
},
notificationReceived: function (notification, payload, sender) {
switch (notification) {
case 'MMM-Screencast:LAUNCH-APP':
this.sendNotification('PAGE_CHANGED', this.config.castPage);
break;
case 'MMM-Screencast:STOP-APP':
this.sendNotification('PAGE_CHANGED', this.config.homePage);
break;
}
},
/**
* Function to log message
* @param {String} message
* @param {String} type
*/
logMessage: function (message, type) {
switch (type) {
case 'erorr':
Log.error(`Module ${this.name} | ${message}`);
break;
default:
Log.info(`Module ${this.name} | ${message}`);
break;
}
},
});