diff --git a/web/classes.js b/web/classes.js index 2067bfc..49fae13 100644 --- a/web/classes.js +++ b/web/classes.js @@ -1,3 +1,26 @@ +class node { + // Constructor to initialize the node + constructor(nodeId) { + this.nodeId = nodeId; + this.temperature = 0; + this.humidity = 0; + this.eCO2 = 0; + this.TVOC = 0; + this.connected = false; + } + // Function to update the data + updateData(temperature, humidity, eCO2, TVOC) { + this.temperature = temperature; + this.humidity = humidity; + this.eCO2 = eCO2; + this.TVOC = TVOC; + } + // Function to update the connection status + updateConnection(status) { + this.connected = status; + } +} + class liveGraph { // Constructor to initialize the graph constructor(id) {