From 27b4b17b7d98fe1f330c1479caee4c60e1fa88a4 Mon Sep 17 00:00:00 2001 From: Gary Cobb Date: Thu, 4 Jul 2024 08:41:43 +0200 Subject: [PATCH] Fix entity_id is None error --- custom_components/icloud3/support/recorder_prefilter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/icloud3/support/recorder_prefilter.py b/custom_components/icloud3/support/recorder_prefilter.py index cc8895d..b85fc1e 100644 --- a/custom_components/icloud3/support/recorder_prefilter.py +++ b/custom_components/icloud3/support/recorder_prefilter.py @@ -116,8 +116,9 @@ def entity_filter(entity_id): Run the original HA recorder_entity_filter function - The entity is not in the filter list. """ - if (entity_id - and entity_id in hass.data['recorder_prefilter']['exclude_entities']): + if entity_id is None: + return False + if entity_id in hass.data['recorder_prefilter']['exclude_entities']): return False return recorder_entity_filter(entity_id)