Commit 4c35282e authored by alain's avatar alain 🐙
Browse files

status info for TEOMS

parent a697cf72
......@@ -78,10 +78,10 @@ export default {
if(dataAgeInHours >= 48 || dataAgeInHours < 0) {
sensorDataReturn.status = 0
} else if(dataAgeInHours < 8) {
sensorDataReturn.mean = sensorData[`${parameter}_mean`]
} else {
} else if(dataAgeInHours > 8) {
sensorDataReturn.status = 1
} else {
sensorDataReturn.mean = sensorData[`${parameter}_mean`]
}
sensorDataReturn.timestamp = sensorData.time
sensorDataReturn.dataAge = dataAgeInHours
......
......@@ -64,11 +64,19 @@ export default {
}
if(sensorData) {
sensorDataReturn.mean = sensorData[`${parameter}_mean`]
const dataAgeInHours = ((new Date() - new Date(sensorData.time)) / 3600000) - 1
if(dataAgeInHours >= 48 || dataAgeInHours < 0) {
sensorDataReturn.status = 0
} else if(dataAgeInHours > 8) {
sensorDataReturn.status = 1
} else {
sensorDataReturn.mean = sensorData[`${parameter}_mean`]
}
sensorDataReturn.timestamp = sensorData.time
sensorDataReturn.dataAge = (new Date() - new Date(sensorData.time)) / 3600000
sensorDataReturn.dataAge = dataAgeInHours
} else {
sensorDataReturn.name = sensorDataReturn.name + " (geen data)"
sensorDataReturn.status = 0
}
return sensorDataReturn
......
data-on-a-map-app @ aacf1b92
Subproject commit 0484a2527d8c652b7a78ede15285e63d230cb22e
Subproject commit aacf1b92e16b648ee38b0ffcff396fae6bdc2c45
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment