Landscape orientation, redesigned web UI, rotation on/off + minutes, weather by city name

- Panel is mounted sideways: render landscape (600x400), rotate to the
  panel's native portrait orientation right before writing to hardware.
- Web UI: card-based layout, dark mode, active nav highlighting, save
  confirmation toasts, error banners.
- Rotation: separate enabled/disabled toggle (off pins to the first screen
  in the list) and the interval is now in minutes instead of raw seconds.
  Migrates existing config.json from the old interval_seconds field.
- Weather: type a city name instead of hunting down coordinates, resolved
  via Open-Meteo's free geocoding API. Manual lat/long still available as
  a fallback.
This commit is contained in:
Honey committed 2026-07-21 22:51:16 +02:00
1 parent 7c197e20a5
commit 61348be674
11 files changed
+393 -104

No files matched your search

+8 -3
View File
@@ -161,9 +161,14 @@ class Scheduler:
screen_ids = list(self.screens.keys())
now = time.time()
if now - self._rotation_switched_at >= rotation["interval_seconds"]:
self._rotation_index = (self._rotation_index + 1) % len(screen_ids)
self._rotation_switched_at = now
# With rotation disabled, just pin to whatever's currently selected --
# never auto-advance. (Manual "show this screen now" still works via
# request_switch(); it just won't stick past the next tick.)
if rotation.get("enabled", True):
interval_seconds = rotation["interval_minutes"] * 60
if now - self._rotation_switched_at >= interval_seconds:
self._rotation_index = (self._rotation_index + 1) % len(screen_ids)
self._rotation_switched_at = now
screen_id = screen_ids[self._rotation_index % len(screen_ids)]
cache = self._caches[screen_id]