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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user