diff --git a/src/main/php/de/thekid/dialog/OpenMeteo.php b/src/main/php/de/thekid/dialog/OpenMeteo.php index 64b4d62..84dee99 100755 --- a/src/main/php/de/thekid/dialog/OpenMeteo.php +++ b/src/main/php/de/thekid/dialog/OpenMeteo.php @@ -35,7 +35,7 @@ public function lookup(string|float $lat, string|float $lon, Date $start, ?Date 'end_date' => ($end ?? $start)->toString('Y-m-d'), 'timezone' => ($tz ?? $start->getTimeZone())->name(), 'daily' => ['sunrise', 'sunset'], - 'hourly' => ['weather_code', 'apparent_temperature'], + 'hourly' => ['weather_code', 'temperature'], ]; // There's a 5-day delay in the historical data; forecasts are provided for 7 days diff --git a/src/main/php/de/thekid/dialog/import/LookupWeather.php b/src/main/php/de/thekid/dialog/import/LookupWeather.php index 0c3f92b..15bd8fd 100755 --- a/src/main/php/de/thekid/dialog/import/LookupWeather.php +++ b/src/main/php/de/thekid/dialog/import/LookupWeather.php @@ -45,7 +45,7 @@ public function execute(Endpoint $api) { // Determine most common weather codes and temperature range $codes= array_slice($result['hourly']['weather_code'], $offset, $length) |> array_count_values(...); - $temp= array_slice($result['hourly']['apparent_temperature'], $offset, $length); + $temp= array_slice($result['hourly']['temperature'], $offset, $length); $min= null === $min ? min($temp) : min($min, min($temp)); $max= null === $max ? max($temp) : max($max, max($temp)); diff --git a/src/test/php/de/thekid/dialog/unittest/LookupWeatherTest.php b/src/test/php/de/thekid/dialog/unittest/LookupWeatherTest.php index 027763b..71b30da 100755 --- a/src/test/php/de/thekid/dialog/unittest/LookupWeatherTest.php +++ b/src/test/php/de/thekid/dialog/unittest/LookupWeatherTest.php @@ -29,14 +29,14 @@ public function lookup(string|float $lat, string|float $lon, Date $start, ?Date 'hourly' => [ 'time' => ['2025-05-29T08:00', '2025-05-29T09:00', '2025-05-29T10:00', '2025-05-29T11:00', '2025-05-29T12:00'], 'weather_code' => ['02', '02', '02', '02', '03'], - 'apparent_temperature' => [9.7, 10.1, 11.3, 12.1, 13.3], + 'temperature' => [9.7, 10.1, 11.3, 12.1, 13.3], ], ], '49.0068901/8.4036527' => [ 'hourly' => [ 'time' => ['2025-05-29T08:00', '2025-05-29T09:00', '2025-05-29T10:00', '2025-05-29T11:00', '2025-05-29T12:00'], 'weather_code' => ['01', '01', '01', '01', '01'], - 'apparent_temperature' => [15.8, 16.2, 17.3, 17.3, 18.4], + 'temperature' => [15.8, 16.2, 17.3, 17.3, 18.4], ], ], };