Filter past events in add-on (>= now)

This commit is contained in:
Tilman Hampl
2026-09-02 08:46:54 +02:00
parent 011be0ea0c
commit 07df40084a
+4
View File
@@ -514,6 +514,10 @@ def build_calendar_events(states: dict[str, dict[str, Any] | None], now: dt.date
all_events.sort(key=sort_key)
# Vergangene Termine herausfiltern (ab jetzt)
now_iso = now.isoformat()
all_events = [ev for ev in all_events if str(ev.get("start", "")) >= now_iso]
# Blacklist: Termine mit bestimmten Stichworten ausblenden
if blacklist_keywords:
all_events = [ev for ev in all_events if not any(kw in str(ev.get("summary", "")).lower() for kw in blacklist_keywords)]