Removed Merge errors (I dont know why they exist) and some logging stuff
This commit is contained in:
parent
c4e7aa945d
commit
49eb0d9959
|
@ -23,7 +23,7 @@ var Notification = function (currentstate) {
|
|||
}, function (err, response) {
|
||||
// response is response from notification
|
||||
});
|
||||
console.log("State changed to Open");
|
||||
//console.log("State changed to Open");
|
||||
} else if (currentstate == false && laststate != false) {
|
||||
laststate == false;
|
||||
notifier.notify({
|
||||
|
@ -35,7 +35,7 @@ var Notification = function (currentstate) {
|
|||
}, function (err, response) {
|
||||
// response is response from notification
|
||||
});
|
||||
console.log("State changed to Close");
|
||||
//console.log("State changed to Close");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
<<<<<<< HEAD
|
||||
"name": "statusbot",
|
||||
"description": "ctdo status bot",
|
||||
"version": "0.0.1",
|
||||
|
@ -16,22 +15,4 @@
|
|||
"moment": "2.3.1"
|
||||
},
|
||||
"main": "index"
|
||||
=======
|
||||
"name": "statusbot",
|
||||
"description": "ctdo status bot",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"connect-flash": "0.1.1",
|
||||
"express": "3.4",
|
||||
"jade": "0.35",
|
||||
"moment": "2.3.1",
|
||||
"net-snmp": "1.1.8",
|
||||
"node-notifier": "^4.2.3",
|
||||
"redis": "0.8.5",
|
||||
"socket.io": "0.9.16",
|
||||
"underscore": "1.5.2"
|
||||
},
|
||||
"main": "index"
|
||||
>>>>>>> 200046b0f183420dd23f391720a740607a1ec288
|
||||
}
|
||||
|
|
|
@ -61,8 +61,6 @@ var ippoll = new IpPoll("switch2.raum.ctdo.de", "195.160.169.30-120");
|
|||
var flukso = new Flukso("flukso.raum.ctdo.de", "/sensor/cf00e0b22230f4a8870af58f2b8719dd");
|
||||
var notification = new Notification(spaceanswer.state.open)
|
||||
|
||||
var laststate = false;
|
||||
|
||||
snmpMac.on('done', function (res) {
|
||||
simpleanswer.names = res;
|
||||
simpleanswer.lastchange = new Date().getTime();
|
||||
|
@ -92,46 +90,10 @@ io.configure(function () {
|
|||
io.set('log level', 0);
|
||||
});
|
||||
|
||||
notifier.on('click', function (notifierObject, options) {
|
||||
// Happens if `wait: true` and user clicks notification
|
||||
});
|
||||
|
||||
notifier.on('timeout', function (notifierObject, options) {
|
||||
// Happens if `wait: true` and notification closes
|
||||
});
|
||||
|
||||
function work() {
|
||||
snmpMac.poll();
|
||||
ippoll.pollCount();
|
||||
<<<<<<< HEAD
|
||||
notification.notificate(spaceanswer.state.open);
|
||||
=======
|
||||
|
||||
if (spaceanswer.state.open == true && laststate != true) {
|
||||
laststate == true;
|
||||
notifier.notify({
|
||||
title: 'CTDO - Statusänderung',
|
||||
message: 'Der Chaostreff Dortmund ist nun offen.',
|
||||
icon: path.join('public/img/green.png'), // absolute path (not balloons)
|
||||
sound: true, // Only Notification Center or Windows Toasters
|
||||
wait: true // wait with callback until user action is taken on notification
|
||||
}, function (err, response) {
|
||||
// response is response from notification
|
||||
});
|
||||
} else if (spaceanswer.state.open == false && lasttaste != false) {
|
||||
laststate == false;
|
||||
|
||||
notifier.notify({
|
||||
title: 'CTDO - Statusänderung',
|
||||
message: 'Der Chaostreff Dortmund ist nun geschlossen.',
|
||||
icon: path.join('public/img/red.png'), // absolute path (not balloons)
|
||||
sound: true, // Only Notification Center or Windows Toasters
|
||||
wait: true // wait with callback until user action is taken on notification
|
||||
}, function (err, response) {
|
||||
// response is response from notification
|
||||
});
|
||||
}
|
||||
>>>>>>> 200046b0f183420dd23f391720a740607a1ec288
|
||||
}
|
||||
|
||||
setInterval(work, 60000);
|
||||
|
|
Loading…
Reference in New Issue