diff --git a/gallery/easel/route/view/weather/filters.py b/gallery/easel/route/view/weather/filters.py index e4d8c20..bb31b52 100644 --- a/gallery/easel/route/view/weather/filters.py +++ b/gallery/easel/route/view/weather/filters.py @@ -29,6 +29,7 @@ def cloudness_icon(sky: Sky, date: datetime.datetime, period: str) -> list[str]: Precipitation.RAIN: "thunderstorm", Precipitation.HEAVY_RAIN: "thunderstorm", Precipitation.SHOWER: "thunderstorm", + Precipitation.SMALL_SNOW: "storm-showers", Precipitation.SNOW: "storm-showers", Precipitation.HEAVY_SNOW: "storm-showers", }[sky.precipitation] @@ -47,6 +48,7 @@ def cloudness_icon(sky: Sky, date: datetime.datetime, period: str) -> list[str]: Precipitation.RAIN: "rain-mix", Precipitation.HEAVY_RAIN: "rain", Precipitation.SHOWER: "rain", + Precipitation.SMALL_SNOW: "snow", Precipitation.SNOW: "snow", Precipitation.HEAVY_SNOW: "snow", Precipitation.HAIL: "hail", diff --git a/gallery/painting/rp5/parser.py b/gallery/painting/rp5/parser.py index b8bfb0a..52e6eac 100644 --- a/gallery/painting/rp5/parser.py +++ b/gallery/painting/rp5/parser.py @@ -86,6 +86,10 @@ class PrecipitationParser(TableValueParser[tuple[Precipitation, float]]): "Явления погоды отсутствуют": Precipitation.NO, "Cлабый дождь": Precipitation.SMALL_RAIN, "Умеренный дождь": Precipitation.RAIN, + "Cлабый дождь со снегом": Precipitation.SMALL_SNOW, + "Слабый снег с дождём": Precipitation.SMALL_SNOW, + "Cлабый снег": Precipitation.SMALL_SNOW, + "Снег": Precipitation.SNOW, } def extract(self, data: Tag) -> tuple[Precipitation, float]: diff --git a/gallery/painting/yandexweather/parser.py b/gallery/painting/yandexweather/parser.py index c11311b..814d165 100644 --- a/gallery/painting/yandexweather/parser.py +++ b/gallery/painting/yandexweather/parser.py @@ -61,7 +61,7 @@ class TemperatureParser(TableValueParser[list[int]]): model_key = "temperature" def extract(self, data: Tag) -> list[int]: - return [int(data.text.strip().rstrip("°"))] + return [int(data.text.strip().rstrip("°").replace("−", "-"))] class SkyParser(TableValueParser[Sky]): @@ -79,6 +79,8 @@ class SkyParser(TableValueParser[Sky]): "небольшой дождь": Precipitation.SMALL_RAIN, "дождь": Precipitation.RAIN, "ливень": Precipitation.SHOWER, + "дождь со снегом": Precipitation.SNOW, + "снег": Precipitation.SNOW, } def extract(self, data: Tag) -> Sky: diff --git a/gallery/sketch/weather/model.py b/gallery/sketch/weather/model.py index ebacc7d..27895c9 100644 --- a/gallery/sketch/weather/model.py +++ b/gallery/sketch/weather/model.py @@ -40,6 +40,7 @@ class Precipitation(StrEnum): RAIN = auto() HEAVY_RAIN = auto() SHOWER = auto() + SMALL_SNOW = auto() SNOW = auto() HEAVY_SNOW = auto() HAIL = auto()