diff --git a/src/utils/export.js b/src/utils/export.js index 0b7a662..35973ca 100644 --- a/src/utils/export.js +++ b/src/utils/export.js @@ -13,6 +13,11 @@ import { getTimestamp } from "../TimeHelper"; function processData(data, t) { const sensorHeaders = ["temperature", "humidity", "pressure", "rssi", "accelerationX", "accelerationY", "accelerationZ", "battery", "movementCounter", "measurementSequenceNumber", "txPower"] + if (data.measurements.length > 0 && data.measurements[0].parsed !== null) { + if (data.measurements[0].parsed.dataFormat === "e0") { + sensorHeaders.push("co2", "voc", "nox", "pm1p0", "pm2p5", "pm4p0", "pm10p0", "illuminance", "soundLevelAvg", "soundLevelPeak") + } + } var csvHeader = [t('date')]; let uHelp = {}; sensorHeaders.forEach(x => {