Remove unused code and update graph in updateNodeData function
This commit is contained in:
16
web/main.js
16
web/main.js
@@ -4,10 +4,6 @@ const sensorData = {};
|
||||
let liveGraphs = [];
|
||||
let nodeArray = [];
|
||||
let nodeDict = {};
|
||||
let funny;
|
||||
// letiables
|
||||
let intervalDelay = 5000;
|
||||
let amountOfNodes = 3;
|
||||
|
||||
const socket = new WebSocket("ws://145.92.8.114/ws");
|
||||
function openConnection() {
|
||||
@@ -188,14 +184,6 @@ function updateNodeData(node, temperature, humidity, eCO2, TVOC) {
|
||||
document.getElementById("TVOCStatus").textContent = "Connected";
|
||||
|
||||
// Update the graph
|
||||
liveGraphs[node -1].updateData(temperature, humidity, eCO2, TVOC);
|
||||
liveGraphs[node - 1].updateData(temperature, humidity, eCO2, TVOC);
|
||||
liveGraphs[node - 1].updateGraph();
|
||||
|
||||
console.log(nodeDict);
|
||||
console.log(nodeArray);
|
||||
}
|
||||
|
||||
// make the graphs
|
||||
liveGraphs.forEach((graph) => {
|
||||
graph.makeGraph();
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user