Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ var NodeHelper = require("node_helper");
module.exports = NodeHelper.create({
start: function() {
console.log("Starting module: " + this.name);

var self = this;
this.expressApp.get('/motioneye/hide/{:id}', function (req, res) {
console.log("Hide registered: " + req.params.id);
res.send('Hide registered: ' + req.params.id);
self.sendSocketNotification("MotionEyeHide", req.params.id);
});
this.expressApp.get('/motioneye/{:id}', function (req, res) {
console.log("Motion registered: " + req.params.id);
res.send('Motion registered: ' + req.params.id);
self.sendSocketNotification("MotionEyeShow", req.params.id);
});
},

socketNotificationReceived: function(notification, config) {
if (notification === "CONFIG") {
console.log("started configuring the node helper of " + this.name);
if (config.autoHide) {
var self = this;

console.log("Hiding camera: " + config.id);
this.sendSocketNotification("MotionEyeHide", config.id);

this.expressApp.get('/motioneye/hide/:id*?', function (req, res) {
console.log("Hide registered: " + req.params.id);
res.send('Hide registered: ' + req.params.id);
self.sendSocketNotification("MotionEyeHide", req.params.id);
});
this.expressApp.get('/motioneye/:id*?', function (req, res) {
console.log("Motion registered: " + req.params.id);
res.send('Motion registered: ' + req.params.id);
self.sendSocketNotification("MotionEyeShow", req.params.id);
});
}
}

return;
}
},
});
});