diff --git a/server.js b/server.js index 76cefc4..71ebde0 100644 --- a/server.js +++ b/server.js @@ -67,7 +67,7 @@ function getLatestSensorData(callback) { humidity: data.humidity, co2: data.co2, pressure: data.pressure, - timestamp: data.timestamp + timestamps: data.timestamps }); }); } diff --git a/static/js/sensor-1.js b/static/js/sensor-1.js index 4304bad..c1fc0cc 100644 --- a/static/js/sensor-1.js +++ b/static/js/sensor-1.js @@ -26,8 +26,8 @@ document.addEventListener('DOMContentLoaded', function () { } // 添加新的数据 - timestamps.push(data.timestamp); - temperatures.push(data.temperature); + timestamps.push(data.timestamps); + temperatures.push(data.temperatures); updateChart(); });