refactor(weather): rework wind parser

This commit is contained in:
2026-09-22 20:58:18 +03:00
parent c0503458e4
commit 3612658323
7 changed files with 57 additions and 62 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ from gallery.sketch.weather.model import (
Precipitation,
WeatherValue,
)
from gallery.sketch.weather.parser import parse_wind_direction
from gallery.sketch.weather.parse.wind import WIND_DIRECTION_PARSER
from gallery.sketch.weather.util import convert_hPa_to_mmHg
from .openweather import Forecast, ForecastItem
@@ -47,7 +47,7 @@ class ForecastItemParser(Parser[ForecastItem, list[WeatherValue]]):
"wind": {
"speed": round(data.wind.speed),
"gust": round(data.wind.gust),
"direction": parse_wind_direction(data.wind.deg),
"direction": WIND_DIRECTION_PARSER.parse(data.wind.deg),
},
"temperature": [round(data.main.temp)], # [round(data.main.temp_max), round(data.main.temp_min)]
"precipitation": round(data.rain.interval_3h, 1) if data.rain else 0,