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