Skip to content

Commit f8679b6

Browse files
authored
[weather] use 'apparent_temperature' in openmeteos data for feelsLike temperature (#3868)
1 parent fad8bba commit f8679b6

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Thanks to: @dathbe.
4848
- [calendar] Fix regression handling of limit days (#3840)
4949
- [calendar] Fixed regression of calendarfetcherutils.shouldEventBeExcluded (#3841)
5050
- [core] Fixed socket.io timeout when server is slow to send notification, notification lost at client (#3380)
51+
- [weather] Use `apparent_temperature` data from openmeteo's hourly weather for current feelsLikeTemp (#3868).
5152

5253
## [2.32.0] - 2025-07-01
5354

@@ -729,7 +730,7 @@ Special thanks to the following contributors: @AmpioRosso, @eouia, @fewieden, @j
729730
### Fixed
730731

731732
- Fixed wrong file `kr.json` to `ko.json`. Use language code 'ko' instead of 'kr' for Korean language.
732-
- Fixed `feels_like` data from openweathermap's current weather being ignored (#2678).
733+
- [weather] Fixed `feels_like` data from openweathermap's current weather being ignored (#2678).
733734
- Fixed chaotic newsfeed display after network connection loss thanks to @jalibu (#2638).
734735
- Fixed incorrect time zone correction of recurring full day events (#2632 and #2634).
735736
- Fixed e2e tests by increasing testTimeout.

modules/default/weather/providers/openmeteo.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WeatherProvider.register("openmeteo", {
1313

1414
/*
1515
* Set the name of the provider.
16-
* Not strictly required, but helps for debugging.
16+
* Not strictly required but helps for debugging.
1717
*/
1818
providerName: "Open-Meteo",
1919

@@ -348,7 +348,7 @@ WeatherProvider.register("openmeteo", {
348348
generateWeatherDayFromCurrentWeather (weather) {
349349

350350
/**
351-
* Since some units comes from API response "splitted" into daily, hourly and current_weather
351+
* Since some units come from API response "splitted" into daily, hourly and current_weather
352352
* every time you request it, you have to ensure to get the data from the right place every time.
353353
* For the current weather case, the response have the following structure (after transposing):
354354
* ```
@@ -381,6 +381,7 @@ WeatherProvider.register("openmeteo", {
381381
currentWeather.maxTemperature = parseFloat(weather.daily[0].temperature_2m_max);
382382
currentWeather.weatherType = this.convertWeatherType(weather.current_weather.weathercode, currentWeather.isDayTime());
383383
currentWeather.humidity = parseFloat(weather.hourly[h].relativehumidity_2m);
384+
currentWeather.feelsLikeTemp = parseFloat(weather.hourly[h].apparent_temperature);
384385
currentWeather.rain = parseFloat(weather.hourly[h].rain);
385386
currentWeather.snow = parseFloat(weather.hourly[h].snowfall * 10);
386387
currentWeather.precipitationAmount = parseFloat(weather.hourly[h].precipitation);

modules/default/weather/weatherutils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const WeatherUtils = {
5353
/**
5454
* Convert temp (from degrees C) into imperial or metric unit depending on
5555
* your config
56-
* @param {number} tempInC the temperature in celsius you want to convert
56+
* @param {number} tempInC the temperature in Celsius you want to convert
5757
* @param {string} unit can be 'imperial' or 'metric'
5858
* @returns {number} the converted temperature
5959
*/

tests/unit/modules/default/weather/weather_utils_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const weather = require("../../../../../modules/default/weather/weatherutils");
22
const WeatherUtils = require("../../../../../modules/default/weather/weatherutils");
33

44
describe("Weather utils tests", () => {
5-
describe("windspeed conversion to imperial", () => {
5+
describe("temperature conversion to imperial", () => {
66
it("should convert temp correctly from Celsius to Fahrenheit", () => {
77
expect(Math.round(WeatherUtils.convertTemp(10, "imperial"))).toBe(50);
88
});

0 commit comments

Comments
 (0)