diff --git a/statusbot.js b/statusbot.js index 4539745..a1c4325 100644 --- a/statusbot.js +++ b/statusbot.js @@ -79,6 +79,7 @@ ippoll.on('doneState', function (state) { simpleanswer.lastchange = spaceanswer.state.lastchange; simpleanswer.lastchange = new Date().getTime(); io.sockets.emit('sdata', {data: simpleanswer}); + console.log("room state changed: " + JSON.stringify(simpleanswer)) }); flukso.on('done', function (num) { @@ -139,9 +140,9 @@ app.get('/api/simple/v2', function (req, res) { function getstatusImage(req, res) { - if (spaceanswer.state.open == true) { + if (spaceanswer.state.open === true) { res.sendFile(path.resolve(__dirname, 'public/img/green.png')); - } else if (spaceanswer.state.open == false) { + } else if (spaceanswer.state.open === false) { res.sendFile(path.resolve(__dirname, 'public/img/red.png')); } else { res.sendFile(path.resolve(__dirname, 'public/img/yellow.png'));