refactor(weather): rework wind parser
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user