1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-20 02:48:57 +00:00

Fix usage_prediction incorrectly accessing target fields (#156937)

This commit is contained in:
karwosts
2025-11-21 06:56:58 -08:00
committed by GitHub
parent 514a329580
commit 00d2340d4b

View File

@@ -144,13 +144,7 @@ async def async_predict_common_control(
if not service_data:
continue
entity_ids: str | list[str] | None
if (target := service_data.get("target")) and (
target_entity_ids := target.get("entity_id")
):
entity_ids = target_entity_ids
else:
entity_ids = service_data.get("entity_id")
entity_ids: str | list[str] | None = service_data.get("entity_id")
# No entity IDs found, skip this event
if entity_ids is None: