Add people_now_present to spaceapi

This commit is contained in:
Fionera 2019-11-20 13:18:03 +01:00 committed by root
parent 1d82202cd3
commit 3591c14c56
1 changed files with 8 additions and 1 deletions

View File

@ -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();
}