Object.keys(data).forEach((key) => {
bannerData[key] = data[key][0];
console.log(key);
if (key == "timestamp") {
labels.push(data[key]);
console.log("wtf");
console.log(labels);
} else {
datasets.push(data[key]);
}
});
generates
exhaust_humidity
exhaust_temperature
intake_humidity
intake_temperature
lights
relay
room_humidity
room_temperature
soil_moisture_1
soil_moisture_2
soil_moisture_3
soil_moisture_4
soil_moisture_5
soil_moisture_6
soil_moisture_7
soil_moisture_8
timestamp
the console.log("wtf"); is never called, because the last key never registers as equal to "timestamp".
Not sure what I'm missing.