Fix CalDAV: read entity_ids from CONFIG, not HA states

This commit is contained in:
Tilman Hampl
2026-09-01 08:53:51 +02:00
parent 22a482d818
commit 011be0ea0c
+3 -2
View File
@@ -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()]