1
0
mirror of https://github.com/beestat/app.git synced 2025-07-09 03:04:07 -04:00

Fixed #397 - CSV downloaded data unusable due to data misalignment: some rows missing TVOC and CO2 cells shifting rightward cells to the left

This commit is contained in:
Jon Ziebell 2023-06-23 06:32:05 -04:00
parent 6ebe758561
commit 90271706ee

View File

@ -1148,14 +1148,12 @@ class runtime extends cora\api {
isset($runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]) === true
)
{
if($runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['air_quality'] !== null) {
$csv_row[] = $runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['air_quality'];
}
if($runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['voc_concentration'] !== null) {
$csv_row[] = $runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['voc_concentration'];
}
if($runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['co2_concentration'] !== null) {
$csv_row[] = $runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['co2_concentration'];
foreach($sensor['capability'] as $capability) {
if($capability['type'] === 'airQuality') {
$csv_row[] = $runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['air_quality'];
$csv_row[] = $runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['voc_concentration'];
$csv_row[] = $runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['co2_concentration'];
}
}
$csv_row[] = $runtime_sensors_by_timestamp[$current_timestamp][$sensor['sensor_id']]['temperature'];