Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open-Meteo: Fix forecast and hourly weather to use real temperatures, not apparent temperatures #3468

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ Thanks to: @kleinmantara (to be continued before release)

### Fixed

- Fix crash possibility if `module: <name>` is not defined and on `postion: <positon>` misktake.
- [core] Fixed crash possibility if `module: <name>` is not defined and on `postion: <positon>` misktake.
- [weather] Fixed precipitationProbability in forecast for provider openmeteo (#3446)
- [weather] Fixed type=daily for provider openmeteo having no data when running after 23:00 (#3449)
- [weather] Fixed type=daily for provider openmeteo showing nightly icons in forecast when current time is "nightly" (#3458)
- [weather] Fixed forecast and hourly weather for provider openmeteo to use real temperatures, not apparent temperatures

## [2.27.0] - 2024-04-01

Expand Down
12 changes: 6 additions & 6 deletions modules/default/weather/providers/openmeteo.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ WeatherProvider.register("openmeteo", {
currentWeather.windFromDirection = weather.winddirection_10m_dominant;
currentWeather.sunrise = weather.sunrise;
currentWeather.sunset = weather.sunset;
currentWeather.temperature = parseFloat((weather.apparent_temperature_max + weather.apparent_temperature_min) / 2);
currentWeather.minTemperature = parseFloat(weather.apparent_temperature_min);
currentWeather.maxTemperature = parseFloat(weather.apparent_temperature_max);
currentWeather.temperature = parseFloat((weather.temperature_2m_max + weather.temperature_2m_min) / 2);
currentWeather.minTemperature = parseFloat(weather.temperature_2m_min);
currentWeather.maxTemperature = parseFloat(weather.temperature_2m_max);
currentWeather.weatherType = this.convertWeatherType(weather.weathercode, true);
currentWeather.rain = parseFloat(weather.rain_sum);
currentWeather.snow = parseFloat(weather.snowfall_sum * 10);
Expand Down Expand Up @@ -432,9 +432,9 @@ WeatherProvider.register("openmeteo", {
currentWeather.windFromDirection = weather.winddirection_10m;
currentWeather.sunrise = weathers.daily[h].sunrise;
currentWeather.sunset = weathers.daily[h].sunset;
currentWeather.temperature = parseFloat(weather.apparent_temperature);
currentWeather.minTemperature = parseFloat(weathers.daily[h].apparent_temperature_min);
currentWeather.maxTemperature = parseFloat(weathers.daily[h].apparent_temperature_max);
currentWeather.temperature = parseFloat(weather.temperature_2m);
currentWeather.minTemperature = parseFloat(weathers.daily[h].temperature_2m_min);
currentWeather.maxTemperature = parseFloat(weathers.daily[h].temperature_2m_max);
currentWeather.weatherType = this.convertWeatherType(weather.weathercode, currentWeather.isDayTime());
currentWeather.humidity = parseFloat(weather.relativehumidity_2m);
currentWeather.rain = parseFloat(weather.rain);
Expand Down