Add weather to calendar mode; fix CalDAV events never showing
Build and push server image / build-and-push (push) Successful in 48s
Build and push server image / build-and-push (push) Successful in 48s
Weather: multiple cities per frame, geocoded via Open-Meteo (no API key), shown above the event list on agenda/today & tomorrow/week views -- never month, no room for it there. Hand-drawn sun/cloud/rain/snow/ thunderstorm icons (no new font/icon asset, same primitives-only approach the rest of calendar_render.py already uses). City geocoding handles "City, State" qualifiers Open-Meteo's own search doesn't (disambiguates same-named cities, e.g. the three "Portland"s). CalDAV fix: events were never showing despite calendars discovering fine, because fetch_calendar_events relied on the calendar-query REPORT's server-side time-range filter, which real servers implement inconsistently (confirmed against a real server, not just guessed -- reproduced locally with Radicale). Switched to fetching every event unfiltered and doing all date-window filtering/expansion client-side, same approach already used for plain ICS feeds.
This commit is contained in:
@@ -145,6 +145,21 @@ def _migration_9(conn) -> None:
|
||||
conn.execute(text("ALTER TABLE user_frames DROP COLUMN calendar_included"))
|
||||
|
||||
|
||||
def _migration_10(conn) -> None:
|
||||
"""Optional weather strip for calendar mode (agenda/today & tomorrow/
|
||||
week views -- never month, see calendar_render.py's _BUILDERS).
|
||||
Multiple cities per frame (calendar_weather_cities), each geocoded
|
||||
once via weather.py's Open-Meteo lookup (no API key) and their daily
|
||||
forecasts refreshed on their own throttle, same shape idiom as
|
||||
calendar_checked_at/calendar_cached_events. Off by default -- no
|
||||
existing frame's render changes until its Calendar tab turns it on."""
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_weather_enabled INTEGER NOT NULL DEFAULT 0"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_weather_units TEXT NOT NULL DEFAULT 'fahrenheit'"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_weather_cities TEXT"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_weather_checked_at REAL NOT NULL DEFAULT 0.0"))
|
||||
conn.execute(text("ALTER TABLE frames ADD COLUMN calendar_weather_cached TEXT"))
|
||||
|
||||
|
||||
MIGRATIONS = [
|
||||
(1, _migration_1),
|
||||
(2, _migration_2),
|
||||
@@ -155,6 +170,7 @@ MIGRATIONS = [
|
||||
(7, _migration_7),
|
||||
(8, _migration_8),
|
||||
(9, _migration_9),
|
||||
(10, _migration_10),
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user