Changed endpoints and db queries, chart now shows suggested mins and maxes
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Ledda's Rooms Climate</title>
|
||||
<title>Ledda's Room Climate</title>
|
||||
<script src="/climate/static/Chart.bundle.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -134,14 +134,14 @@
|
||||
removeExpiredData(chart, snapshot.time);
|
||||
insertSnapshot(chart, snapshot);
|
||||
}
|
||||
}, 10 * 1000);
|
||||
}, 30 * 1000);
|
||||
}
|
||||
|
||||
function insertSnapshot(chart, snapshot) {
|
||||
chart.data.datasets[0].data.push({x: snapshot.time, y: snapshot.humidity});
|
||||
chart.data.datasets[1].data.push({x: snapshot.time, y: snapshot.temp});
|
||||
chart.data.datasets[2].data.push({x: snapshot.time, y: snapshot.co2});
|
||||
chart.update(0);
|
||||
chart.update();
|
||||
}
|
||||
|
||||
function removeExpiredData(chart, latestTime) {
|
||||
|
||||
Reference in New Issue
Block a user