diff --git a/app/Services/BiAngDeviceLogService.php b/app/Services/BiAngDeviceLogService.php index 471a2f4..97ca970 100644 --- a/app/Services/BiAngDeviceLogService.php +++ b/app/Services/BiAngDeviceLogService.php @@ -304,7 +304,7 @@ class BiAngDeviceLogService $attributes = value(function ($meteorologicalReports) { $data = [ - 'current_rainfall' => ['sum' => 0, 'count' => 0], + 'current_rainfall' => 0, 'illumination' => ['sum' => 0, 'count' => 0], 'air_temperature' => ['sum' => 0, 'count' => 0], 'air_humidity' => ['sum' => 0, 'count' => 0], @@ -340,6 +340,8 @@ class BiAngDeviceLogService foreach ($data as $key => $item) { switch ($key) { + case 'current_rainfall': + $attributes['daily_rainfall'] = $item; case 'wind_samples': if (! empty($item)) { $attributes['wind_degree'] = value(function (array $windSamples) {