fix(weather): optional pressure and humidity in weather value

This commit is contained in:
2026-08-21 10:19:52 +03:00
parent 555b7f4392
commit f79f754f1b
2 changed files with 4 additions and 4 deletions
@@ -173,7 +173,7 @@
{% for value in response.values %} {% for value in response.values %}
<td class="humidity" <td class="humidity"
style="background-color: rgba(128, 128, 255, {{value.humidity * 0.005}});"> style="background-color: rgba(128, 128, 255, {{value.humidity * 0.005}});">
<span class="value">{{value.humidity}}</span> {% if value.humidity > -1%}<span class="value">{{value.humidity}}</span>{% endif %}
</td> </td>
{% endfor %} {% endfor %}
</tr> </tr>
+3 -3
View File
@@ -2,7 +2,7 @@ import datetime
from enum import StrEnum, auto from enum import StrEnum, auto
from typing import Self from typing import Self
from pydantic import BaseModel from pydantic import BaseModel, Field
class Model(BaseModel): class Model(BaseModel):
@@ -116,8 +116,8 @@ class WeatherValue(Model):
wind_gust: int wind_gust: int
wind_direction: float wind_direction: float
precipitation: float precipitation: float
pressure: list[int] pressure: list[int] = Field(default=[])
humidity: int humidity: int = Field(default=-1)
class WeatherResponse(Model): class WeatherResponse(Model):