Weather: default to 5-day forecast, add weekday+date header line

- forecast_days now defaults to 5 (was 3) across default_settings(),
  check()'s fallback, and the settings form's pre-selected option.
- New show_date setting (on by default): weekday + date in the same
  "Samstag, 25. Juli" format Clock already used. Combined with the
  city name into one header line above the icon/temp block when both
  are on ("Münster · Samstag, 25. Juli"), each independently
  toggleable.
- Moved the weekday/month name lists and the "Weekday, D. Month"
  formatting out of clock.py into render_utils.format_date_de(), so
  Weather reuses the exact same formatting instead of a second copy
  that could drift.
This commit is contained in:
Honey committed 2026-07-25 10:38:14 +02:00
1 parent 78337a99d2
commit 7601f746fe
5 files changed
+50 -32

No files matched your search

+3 -2
View File
@@ -66,12 +66,13 @@ def create_app(config, screens: dict, scheduler) -> Flask:
city = request.form.get("city", "").strip()
lat_raw = request.form.get("latitude", "").strip()
lon_raw = request.form.get("longitude", "").strip()
forecast_days = int(request.form.get("forecast_days", 3) or 3)
forecast_days = int(request.form.get("forecast_days", 5) or 5)
if forecast_days not in (3, 5, 7):
forecast_days = 3
forecast_days = 5
update_minutes = max(1, int(request.form.get("update_minutes", 30) or 30))
display_toggles = {
"show_city": "show_city" in request.form,
"show_date": "show_date" in request.form,
"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,
+6 -2
View File
@@ -24,8 +24,8 @@
<div class="field">
<label for="forecast_days">Days to show</label>
<select id="forecast_days" name="forecast_days">
<option value="3" {{ "selected" if settings.forecast_days == 3 or not settings.forecast_days }}>3 days</option>
<option value="5" {{ "selected" if settings.forecast_days == 5 }}>5 days</option>
<option value="3" {{ "selected" if settings.forecast_days == 3 }}>3 days</option>
<option value="5" {{ "selected" if settings.forecast_days == 5 or not settings.forecast_days }}>5 days</option>
<option value="7" {{ "selected" if settings.forecast_days == 7 }}>7 days</option>
</select>
</div>
@@ -39,6 +39,10 @@
<input type="checkbox" name="show_city" {{ "checked" if settings.show_city != False }}>
City name
</label>
<label class="checkbox">
<input type="checkbox" name="show_date" {{ "checked" if settings.show_date != False }}>
Weekday + date
</label>
<label class="checkbox">
<input type="checkbox" name="show_hourly_graph" {{ "checked" if settings.show_hourly_graph != False }}>
Hourly temperature graph