modified: server.js
This commit is contained in:
parent
3d372000c8
commit
c23b8b6675
15
server.js
15
server.js
@ -61,17 +61,14 @@ function getLatestSensorData(callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = results[0];
|
||||
const timestamps = results.map(row => new Date(row.timestamp).toISOString().slice(0, 19).replace('T', ' '));
|
||||
const temperatures = results.map(row => row.temperature);
|
||||
const humidities = results.map(row => row.humidity);
|
||||
const co2 = results.map(row => row.co2);
|
||||
const pressure = results.map(row => row.pressure);
|
||||
callback({
|
||||
timestamps,
|
||||
temperatures,
|
||||
humidities,
|
||||
co2,
|
||||
pressure
|
||||
temperatures: data.temperature,
|
||||
humidity: data.humidity,
|
||||
co2: data.co2,
|
||||
pressure: data.pressure,
|
||||
timestamps
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user