Skip to content

Commit

Permalink
Fix repairs of dashboards case where service target is a template (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Jun 1, 2023
1 parent bc4c4ac commit 13a888c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,11 @@ def __async_extract_entities_from_action(self, config: dict[str, Any]) -> set[st
"""Extract entities from a dashboard action config."""
entities = set()
for key in ("service_data", "target"):
if (target := config.get(key)) and (entity_id := target.get("entity_id")):
if (
(target := config.get(key))
and isinstance(target, dict)
and (entity_id := target.get("entity_id"))
):
if isinstance(entity_id, str):
entities.add(entity_id)
if isinstance(entity_id, list):
Expand Down

0 comments on commit 13a888c

Please sign in to comment.