Skip to content

Commit

Permalink
Add tag for createmodule and notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
roramirez committed Feb 17, 2017
1 parent a00bd58 commit 56d0bec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions MagicMirror-Module-Template.js
Expand Up @@ -7,7 +7,7 @@
* {{LICENSE}} Licensed.
*/

Module.register("MagicMirror-Module-Template", {
Module.register("{{MODULE_NAME}}", {
defaults: {
updateInterval: 60000,
retryDelay: 5000
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions node_helper.js
Expand Up @@ -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 :)
Expand All @@ -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
Expand Down

0 comments on commit 56d0bec

Please sign in to comment.