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