From 3591c14c563c753ace83be02fd0107cc61590718 Mon Sep 17 00:00:00 2001 From: Fionera Date: Wed, 20 Nov 2019 13:18:03 +0100 Subject: [PATCH] Add people_now_present to spaceapi --- node/statusbot.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/node/statusbot.js b/node/statusbot.js index 19cbd94..d620c6b 100644 --- a/node/statusbot.js +++ b/node/statusbot.js @@ -61,7 +61,11 @@ var spaceanswer = { description: "overall power consumption from our space", location: "basement", value: 0 - }] + }], + people_now_present: [{ + value: 0, + names: [] + }] } }; var simpleanswer = {state: "unknown", count: 0, names: [], lastchange: 0, power: 0}; @@ -82,6 +86,9 @@ ctdoapi.on('done', function (answer) { simpleanswer.count = answer.count; simpleanswer.names = answer.names; + spaceanswer.sensors.people_now_present.value = answer.count; + spaceanswer.sensors.people_now_present.value = answer.names; + if (usercountanswer.datapoints.length > 20) { usercountanswer.datapoints.shift(); }