Update
parent
132c36e9ef
commit
f11d16251d
|
|
@ -448,6 +448,10 @@ class DeviceLogService
|
|||
switch ($key) {
|
||||
case 'wind_samples':
|
||||
$attributes['wind_degree'] = value(function (array $windSamples) {
|
||||
if (empty($windSamples)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$x = 0;
|
||||
$y = 0;
|
||||
|
||||
|
|
@ -477,6 +481,10 @@ class DeviceLogService
|
|||
}, $item);
|
||||
|
||||
$attributes['wind_direction'] = value(function ($windDegree) {
|
||||
if (is_null($windDegree)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($windDegree >= 22.5 && $windDegree < 67.5) {
|
||||
return MeteorologicalDailyReport::WIND_DIRECTION_NORTHEAST;
|
||||
} elseif ($windDegree >= 67.5 && $windDegree < 112.5) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue