Weather: icon-left/temp-right layout, feels-like/high-low/rain
chance, and an hourly temperature graph - Current conditions block redone horizontally (icon left, big temp + description + an extras line on the right) instead of stacked vertically. - New extras line: "feels like" (apparent_temperature), today's high/low, and rain chance (precipitation_probability_max) -- each independently toggleable in settings, all on by default. Switched from the legacy current_weather=true param to Open-Meteo's current= param, since that's what exposes apparent_temperature; confirmed field names/formats live before wiring them in. - New hourly-today temperature graph (also toggleable): a polyline across today's 24 hourly points, min/max temps labeled at their points, a red dot marking the current hour, and hour labels along the bottom. - When both the graph and the daily forecast strip are shown, they split the remaining vertical space; either can be toggled off to give the other more room, matching how forecast_days already worked.
This commit is contained in:
1 parent
132e133b1d
commit
27f4397b04
3 files changed
+218
-58
No files matched your search
@@ -69,6 +69,12 @@ def create_app(config, screens: dict, scheduler) -> Flask:
|
||||
if forecast_days not in (3, 5, 7):
|
||||
forecast_days = 3
|
||||
update_minutes = max(1, int(request.form.get("update_minutes", 30) or 30))
|
||||
display_toggles = {
|
||||
"show_hourly_graph": "show_hourly_graph" in request.form,
|
||||
"show_feels_like": "show_feels_like" in request.form,
|
||||
"show_high_low": "show_high_low" in request.form,
|
||||
"show_rain_chance": "show_rain_chance" in request.form,
|
||||
}
|
||||
|
||||
if city:
|
||||
try:
|
||||
@@ -84,6 +90,7 @@ def create_app(config, screens: dict, scheduler) -> Flask:
|
||||
"longitude": result["longitude"],
|
||||
"forecast_days": forecast_days,
|
||||
"update_minutes": update_minutes,
|
||||
**display_toggles,
|
||||
})
|
||||
return redirect(url_for("settings_weather", saved=1))
|
||||
else:
|
||||
@@ -93,6 +100,7 @@ def create_app(config, screens: dict, scheduler) -> Flask:
|
||||
"longitude": float(lon_raw) if lon_raw else None,
|
||||
"forecast_days": forecast_days,
|
||||
"update_minutes": update_minutes,
|
||||
**display_toggles,
|
||||
})
|
||||
return redirect(url_for("settings_weather", saved=1))
|
||||
|
||||
|
||||
@@ -34,6 +34,24 @@
|
||||
<input type="number" id="update_minutes" name="update_minutes" min="1" value="{{ settings.update_minutes or 30 }}">
|
||||
<p class="hint">Weather itself only refreshes the panel when something actually changed, so a shorter interval here mostly just means fresher data, not more flashing.</p>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="show_hourly_graph" {{ "checked" if settings.show_hourly_graph != False }}>
|
||||
Hourly temperature graph
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="show_feels_like" {{ "checked" if settings.show_feels_like != False }}>
|
||||
"Feels like" temperature
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="show_high_low" {{ "checked" if settings.show_high_low != False }}>
|
||||
Today's high/low
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="show_rain_chance" {{ "checked" if settings.show_rain_chance != False }}>
|
||||
Rain chance
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
|
||||
Reference in new issue
Block a user