From f79f754f1b0b8c8c73f20090e5aefbe5dfe57c21 Mon Sep 17 00:00:00 2001 From: shmyga Date: Fri, 21 Aug 2026 10:19:52 +0300 Subject: [PATCH] fix(weather): optional pressure and humidity in weather value --- gallery/easel/route/view/weather/templates/weather.html | 2 +- gallery/sketch/weather/model.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gallery/easel/route/view/weather/templates/weather.html b/gallery/easel/route/view/weather/templates/weather.html index f64615f..509e39c 100644 --- a/gallery/easel/route/view/weather/templates/weather.html +++ b/gallery/easel/route/view/weather/templates/weather.html @@ -173,7 +173,7 @@ {% for value in response.values %} - {{value.humidity}} + {% if value.humidity > -1%}{{value.humidity}}{% endif %} {% endfor %} diff --git a/gallery/sketch/weather/model.py b/gallery/sketch/weather/model.py index da49b17..08d05fb 100644 --- a/gallery/sketch/weather/model.py +++ b/gallery/sketch/weather/model.py @@ -2,7 +2,7 @@ import datetime from enum import StrEnum, auto from typing import Self -from pydantic import BaseModel +from pydantic import BaseModel, Field class Model(BaseModel): @@ -116,8 +116,8 @@ class WeatherValue(Model): wind_gust: int wind_direction: float precipitation: float - pressure: list[int] - humidity: int + pressure: list[int] = Field(default=[]) + humidity: int = Field(default=-1) class WeatherResponse(Model):