mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Fix usage_prediction incorrectly accessing target fields (#156937)
This commit is contained in:
@@ -144,13 +144,7 @@ async def async_predict_common_control(
|
|||||||
if not service_data:
|
if not service_data:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
entity_ids: str | list[str] | None
|
entity_ids: str | list[str] | None = service_data.get("entity_id")
|
||||||
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")
|
|
||||||
|
|
||||||
# No entity IDs found, skip this event
|
# No entity IDs found, skip this event
|
||||||
if entity_ids is None:
|
if entity_ids is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user