removed usercount and names from api

This commit is contained in:
Lucas Pleß 2022-09-04 13:04:34 +02:00
parent 782d4a1a35
commit 275b27448c
1 changed files with 4 additions and 16 deletions

View File

@ -60,17 +60,11 @@ var spaceanswer = {
description: "overall power consumption from our space", description: "overall power consumption from our space",
location: "basement", location: "basement",
value: 0 value: 0
}],
people_now_present: [{
value: 0,
names: []
}] }]
} }
}; };
var simpleanswer = {state: "unknown", count: 0, names: [], lastchange: 0, power: 0}; var simpleanswer = {state: "unknown", lastchange: 0, power: 0};
var usercountanswer = {
at: 0, current_value: 0, datapoints: []
};
var ippoll = new IpPoll("rpi3.raum.ctdo.de"); var ippoll = new IpPoll("rpi3.raum.ctdo.de");
var flukso = new Flukso("flukso.raum.ctdo.de", "/sensor/cf00e0b22230f4a8870af58f2b8719dd"); var flukso = new Flukso("flukso.raum.ctdo.de", "/sensor/cf00e0b22230f4a8870af58f2b8719dd");
@ -150,11 +144,6 @@ app.get('/api/simple/v2', function (req, res) {
res.send(simpleanswer); res.send(simpleanswer);
}); });
app.get('/api/usercount', function (req, res) {
usercountanswer.at = simpleanswer.lastchange;
usercountanswer.current_value = simpleanswer.count;
res.send(usercountanswer);
});
function getstatusImage(req, res) { function getstatusImage(req, res) {
if (spaceanswer.state.open == true) { if (spaceanswer.state.open == true) {
@ -174,8 +163,7 @@ app.get('/api/simple/image.png', function (req, res) {
getstatusImage(req, res); getstatusImage(req, res);
}); });
//app.get('/db', routes.db);
//app.post('/form', routes.form);
app.get('/', routes.index); app.get('/', routes.index);
var server = server.listen(port, address, function (err) { var server = server.listen(port, address, function (err) {