From 56d0bec7de99464d005df457c7b018ed5b2a0ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Fri, 17 Feb 2017 13:58:14 -0300 Subject: [PATCH] Add tag for createmodule and notifications --- MagicMirror-Module-Template.js | 6 +++--- node_helper.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MagicMirror-Module-Template.js b/MagicMirror-Module-Template.js index 02189f8..f138fef 100644 --- a/MagicMirror-Module-Template.js +++ b/MagicMirror-Module-Template.js @@ -7,7 +7,7 @@ * {{LICENSE}} Licensed. */ -Module.register("MagicMirror-Module-Template", { +Module.register("{{MODULE_NAME}}", { defaults: { updateInterval: 60000, retryDelay: 5000 @@ -127,12 +127,12 @@ Module.register("MagicMirror-Module-Template", { // the data if load // send notification to helper - this.sendSocketNotification("NOTIFICATION_TEST", data); + this.sendSocketNotification("{{MODULE_NAME}}-NOTIFICATION_TEST", data); }, // socketNotificationReceived from helper socketNotificationReceived: function (notification, payload) { - if(notification === "NOTIFICATION_TEST") { + if(notification === "{{MODULE_NAME}}-NOTIFICATION_TEST") { // set dataNotification this.dataNotification = payload; this.updateDom(); diff --git a/node_helper.js b/node_helper.js index 09b9ed1..427bb44 100644 --- a/node_helper.js +++ b/node_helper.js @@ -18,7 +18,7 @@ module.exports = NodeHelper.create({ * argument payload mixed - The payload of the notification. */ socketNotificationReceived: function(notification, payload) { - if (notification === "NOTIFICATION_TEST") { + if (notification === "{{MODULE_NAME}}-NOTIFICATION_TEST") { console.log("Working notification system. Notification:", notification, "payload: ", payload); // Send notification this.sendNotificationTest(this.anotherFunction()); //Is possible send objects :) @@ -27,7 +27,7 @@ module.exports = NodeHelper.create({ // Example function send notification test sendNotificationTest: function(payload) { - this.sendSocketNotification("NOTIFICATION_TEST", payload); + this.sendSocketNotification("{{MODULE_NAME}}-NOTIFICATION_TEST", payload); }, // this you can create extra routes for your module