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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const data = results[0];
|
||||||
const timestamps = results.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 = 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({
|
callback({
|
||||||
timestamps,
|
temperatures: data.temperature,
|
||||||
temperatures,
|
humidity: data.humidity,
|
||||||
humidities,
|
co2: data.co2,
|
||||||
co2,
|
pressure: data.pressure,
|
||||||
pressure
|
timestamps
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user