From 3dd8b88f72cda66fedf2a5e2d79c173dd75e81eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Sun, 4 Sep 2022 14:19:57 +0200 Subject: [PATCH] fixed statusbot.js if syntax, added console log for flukso --- statusbot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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'));