-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMMM-Attend.js
45 lines (39 loc) · 1004 Bytes
/
MMM-Attend.js
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
43
44
45
Module.register("MMM-Attend",{
// Default module config.
defaults: {
updateInterval: 30000,
fadespeed: 4000
},
getDom: function() {
var e = document.createElement("div")
e.id = "DISPLAY"
//console.log (test)
return e
},
start: function() {
Log.info('Starting module: ' + this.name);
},
notificationReceived: function(notification, payload, sender) {
switch(notification) {
case "DOM_OBJECTS_CREATED":
var timer = setInterval(()=>{
this.sendSocketNotification("GIVE_ME_DATA")
//var test = "kel"
}, 1000)
break
}
},
socketNotificationReceived: function(notification, payload) {
switch(notification) {
case "HERE_IS_DATA":
var e = document.getElementById("DISPLAY")
e.innerHTML = payload // display nama
var timer = setInterval(() =>{
console.log ("e", e.innerHTML)
}, 1000)
}
},
getStyles: function() {
return ['MMM-Attend.css']
},
})