Remove unused code and update graph in updateNodeData function

This commit is contained in:
sietse jonker
2024-03-14 17:27:15 +01:00
parent b3d80c1194
commit 065cb42ef7

View File

@@ -4,10 +4,6 @@ const sensorData = {};
let liveGraphs = []; let liveGraphs = [];
let nodeArray = []; let nodeArray = [];
let nodeDict = {}; let nodeDict = {};
let funny;
// letiables
let intervalDelay = 5000;
let amountOfNodes = 3;
const socket = new WebSocket("ws://145.92.8.114/ws"); const socket = new WebSocket("ws://145.92.8.114/ws");
function openConnection() { function openConnection() {
@@ -188,14 +184,6 @@ function updateNodeData(node, temperature, humidity, eCO2, TVOC) {
document.getElementById("TVOCStatus").textContent = "Connected"; document.getElementById("TVOCStatus").textContent = "Connected";
// Update the graph // Update the graph
liveGraphs[node -1].updateData(temperature, humidity, eCO2, TVOC); liveGraphs[node - 1].updateData(temperature, humidity, eCO2, TVOC);
liveGraphs[node - 1].updateGraph(); liveGraphs[node - 1].updateGraph();
console.log(nodeDict);
console.log(nodeArray);
} }
// make the graphs
liveGraphs.forEach((graph) => {
graph.makeGraph();
});