Skip to content

Commit 00d2340

Browse files
authored
Fix usage_prediction incorrectly accessing target fields (home-assistant#156937)
1 parent 514a329 commit 00d2340

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

homeassistant/components/usage_prediction/common_control.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,7 @@ async def async_predict_common_control(
144144
if not service_data:
145145
continue
146146

147-
entity_ids: str | list[str] | None
148-
if (target := service_data.get("target")) and (
149-
target_entity_ids := target.get("entity_id")
150-
):
151-
entity_ids = target_entity_ids
152-
else:
153-
entity_ids = service_data.get("entity_id")
147+
entity_ids: str | list[str] | None = service_data.get("entity_id")
154148

155149
# No entity IDs found, skip this event
156150
if entity_ids is None:

0 commit comments

Comments
 (0)