Refactor code to dynamically create node data and live graphs

This commit is contained in:
sietse jonker
2024-03-07 13:00:22 +01:00
parent 2e394f3d45
commit bc8cc500cb

View File

@@ -192,13 +192,10 @@ function updateNodeData(node, temperature, humidity, eCO2, TVOC) {
}
// Call the function to create the HTML structure
createNodeData(1);
createNodeData(2);
createNodeData(3);
createNodeData(4);
// Create a new liveGraph object
liveGraphs.push(new liveGraph(1));
for (let i = 1; i <= 4; i++) {
createNodeData(i);
liveGraphs.push(new liveGraph(i));
}
// make the graphs
liveGraphs.forEach((graph) => {