From 011be0ea0cc15c6aa170a02c3cfbdf8e261e8d15 Mon Sep 17 00:00:00 2001 From: Tilman Hampl Date: Tue, 1 Sep 2026 08:53:51 +0200 Subject: [PATCH] Fix CalDAV: read entity_ids from CONFIG, not HA states --- x3_dashboard/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x3_dashboard/server.py b/x3_dashboard/server.py index 8491704..fa53f05 100644 --- a/x3_dashboard/server.py +++ b/x3_dashboard/server.py @@ -443,8 +443,9 @@ def build_calendar_events(states: dict[str, dict[str, Any] | None], now: dt.date all_events: list[dict[str, Any]] = [] caldav_keys = ["calendar_1", "calendar_2"] - caldav_entity_ids = [st(states, k, "") for k in caldav_keys if st(states, k, "")] - local_sensor_id = st(states, "local_calendar_sensor", "") + caldav_entity_ids = [CONFIG.get("entity_ids", {}).get(k, "") for k in caldav_keys] + caldav_entity_ids = [eid for eid in caldav_entity_ids if eid and eid.startswith("calendar.")] + local_sensor_id = CONFIG.get("entity_ids", {}).get("local_calendar_sensor", "") blacklist_str = str(CONFIG.get("calendar_blacklist") or "") blacklist_keywords = [kw.strip().lower() for kw in blacklist_str.split(",") if kw.strip()]