Skip to content

Commit

Permalink
Fix min. temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Dec 31, 2024
1 parent b29c5c7 commit af5e0d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/php/de/thekid/dialog/import/LookupWeather.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function execute(Endpoint $api) {
$end= array_search(Dates::truncate($last, TimeInterval::$HOURS)->toString('Y-m-d\TH:i'), $result['hourly']['time']);

// Determine most common weather codes and temperature range
$codes= array_count_values(array_slice($result['hourly']['weather_code'], $min, 1 + ($end - $start)));
$codes= array_count_values(array_slice($result['hourly']['weather_code'], $start, 1 + ($end - $start)));
$temp= array_slice($result['hourly']['apparent_temperature'], $start, 1 + ($end - $start));
$min= null === $min ? min($temp) : min($min, min($temp));
$max= null === $max ? max($temp) : max($max, max($temp));
Expand Down

0 comments on commit af5e0d7

Please sign in to comment.