-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode_helper.js
37 lines (30 loc) · 1012 Bytes
/
node_helper.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
/* Magic Mirror
* Node Helper: MMM-SolarEdge-InverterMonitor
*
* By Enrique Cardona
* MIT Licensed.
*/
var NodeHelper = require("node_helper");
module.exports = NodeHelper.create({
// Override socketNotificationReceived method.
/* socketNotificationReceived(notification, payload)
* This method is called when a socket notification arrives.
*
* argument notification string - The identifier of the noitication.
* argument payload mixed - The payload of the notification.
*/
socketNotificationReceived: function(notification, payload) {
if (notification === "MMM-SolarEdge-InverterMonitor-NOTIFICATION_TEST") {
// Send notification
this.sendNotificationTest(this.anotherFunction()); //Is possible send objects :)
}
},
// Example function send notification test
sendNotificationTest: function(payload) {
this.sendSocketNotification("MMM-SolarEdge-InverterMonitor-NOTIFICATION_TEST", payload);
},
// Test another function
anotherFunction: function() {
return {};
}
});