fixed statusbot.js if syntax, added console log for flukso

This commit is contained in:
Lucas Pleß 2022-09-04 14:19:57 +02:00
parent 1b29aa6044
commit 3dd8b88f72
1 changed files with 3 additions and 2 deletions

View File

@ -79,6 +79,7 @@ ippoll.on('doneState', function (state) {
simpleanswer.lastchange = spaceanswer.state.lastchange; simpleanswer.lastchange = spaceanswer.state.lastchange;
simpleanswer.lastchange = new Date().getTime(); simpleanswer.lastchange = new Date().getTime();
io.sockets.emit('sdata', {data: simpleanswer}); io.sockets.emit('sdata', {data: simpleanswer});
console.log("room state changed: " + JSON.stringify(simpleanswer))
}); });
flukso.on('done', function (num) { flukso.on('done', function (num) {
@ -139,9 +140,9 @@ app.get('/api/simple/v2', function (req, res) {
function getstatusImage(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')); 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')); res.sendFile(path.resolve(__dirname, 'public/img/red.png'));
} else { } else {
res.sendFile(path.resolve(__dirname, 'public/img/yellow.png')); res.sendFile(path.resolve(__dirname, 'public/img/yellow.png'));