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

adjust for muv monitoring stations

parent 11e203ba
......@@ -56,11 +56,16 @@ export default {
const data = all.filter(sensor => {
return filterExtended ? sensor.extended : true
}).map(sensor => {
const sensorData = latest.find(o => +o.id === +sensor.id)
const kitType = sensor.id > 1000000 ? "MUV-kit" : "HOLU-kit"
const idPrefix = sensor.id > 1000000 ? "HLL_MUV_device_" : ""
const sensorData = latest.find(o => o.id.toString().replace(idPrefix, "") === sensor.id.toString())
const sensorDataReturn = {
id: sensor.id.toString(),
name: `HOLU-kit ${sensor.id.toString()}: ${sensor.tag} - ${sensor.name}`,
id: idPrefix + sensor.id,
name: `${kitType} ${sensor.id.toString()}: ${sensor.tag} - ${sensor.name}`,
source: "holu",
type: sensor.extended ? "extended" : "basic",
coordinates: [sensor.longitude, sensor.latitude],
......@@ -149,7 +154,12 @@ export default {
let data = []
if(parameter === "pm25" || parameter === "pm10") {
const responseRaw = await fetch(`https://data.waag.org/api/getHourlyValuesSensor?sensor_id=${station.id}&start=${start}&end=${end}`)
let rawURL = `https://data.waag.org/api/getHourlyValuesSensor?sensor_id=${station.id}&start=${start}&end=${end}`
if(station.id.includes('MUV')) {
rawURL = `https://data.waag.org/api/muv/ms/hourly?sensor_id=${station.id.replace('HLL_MUV_device_','')}&start=${start}&end=${end}`
}
const responseRaw = await fetch(rawURL)
const jsonRaw = await responseRaw.json()
let dataRaw = jsonRaw.map(m => {
......
Subproject commit 265ec7f4d1d1d7905e512e20106b7e7ebaa129cf
Subproject commit fadf0052e22cd25bd01692b82d7006ca294bec5d
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