diff --git a/apps/predbat/ha.py b/apps/predbat/ha.py index 40c671e75..97a51a01f 100644 --- a/apps/predbat/ha.py +++ b/apps/predbat/ha.py @@ -148,7 +148,7 @@ def update_entity(self, entity_id, new_history_data): # Filter useless data from history data for entry in new_history_data: - if "attributes" in entry: + if entry.get("attributes"): for attr in FILTER_ATTRIBUTES: entry["attributes"].pop(attr, None) for entry_attr in FILTER_ENTRIES: