summaryrefslogtreecommitdiff
path: root/searx/engines/open_meteo.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/engines/open_meteo.py')
-rw-r--r--searx/engines/open_meteo.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/searx/engines/open_meteo.py b/searx/engines/open_meteo.py
index 31ada12b0..948996b3c 100644
--- a/searx/engines/open_meteo.py
+++ b/searx/engines/open_meteo.py
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Open Meteo (weather)"""
+import typing as t
+
from urllib.parse import urlencode
from datetime import datetime
@@ -106,16 +108,16 @@ WMO_TO_CONDITION: dict[int, weather.WeatherConditionType] = {
}
-def _weather_data(location: weather.GeoLocation, data: dict):
+def _weather_data(location: weather.GeoLocation, data: dict[str, t.Any]):
return WeatherAnswer.Item(
location=location,
- temperature=weather.Temperature(unit="°C", value=data["temperature_2m"]),
+ temperature=weather.Temperature(val=data["temperature_2m"], unit="°C"),
condition=WMO_TO_CONDITION[data["weather_code"]],
- feels_like=weather.Temperature(unit="°C", value=data["apparent_temperature"]),
+ feels_like=weather.Temperature(val=data["apparent_temperature"], unit="°C"),
wind_from=weather.Compass(data["wind_direction_10m"]),
- wind_speed=weather.WindSpeed(data["wind_speed_10m"], unit="km/h"),
- pressure=weather.Pressure(data["pressure_msl"], unit="hPa"),
+ wind_speed=weather.WindSpeed(val=data["wind_speed_10m"], unit="km/h"),
+ pressure=weather.Pressure(val=data["pressure_msl"], unit="hPa"),
humidity=weather.RelativeHumidity(data["relative_humidity_2m"]),
cloud_cover=data["cloud_cover"],
)