Fix CalDAV: read entity_ids from CONFIG, not HA states
This commit is contained in:
@@ -443,8 +443,9 @@ def build_calendar_events(states: dict[str, dict[str, Any] | None], now: dt.date
|
|||||||
all_events: list[dict[str, Any]] = []
|
all_events: list[dict[str, Any]] = []
|
||||||
|
|
||||||
caldav_keys = ["calendar_1", "calendar_2"]
|
caldav_keys = ["calendar_1", "calendar_2"]
|
||||||
caldav_entity_ids = [st(states, k, "") for k in caldav_keys if st(states, k, "")]
|
caldav_entity_ids = [CONFIG.get("entity_ids", {}).get(k, "") for k in caldav_keys]
|
||||||
local_sensor_id = st(states, "local_calendar_sensor", "")
|
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_str = str(CONFIG.get("calendar_blacklist") or "")
|
||||||
blacklist_keywords = [kw.strip().lower() for kw in blacklist_str.split(",") if kw.strip()]
|
blacklist_keywords = [kw.strip().lower() for kw in blacklist_str.split(",") if kw.strip()]
|
||||||
|
|||||||
Reference in New Issue
Block a user