From a4f814bfac8cc64a819638a3f4ca4270a0d565d9 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Thu, 3 Aug 2023 22:49:00 +0800 Subject: [PATCH] Update --- app/Services/BiAngDeviceLogService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {