From 4cf910affc162586f7b0347f2ab7cd76271b4055 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 4 May 2021 14:23:22 -0700 Subject: [PATCH] Guard logbook assuming entity ID is a string (#50047) --- homeassistant/components/logbook/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/logbook/__init__.py b/homeassistant/components/logbook/__init__.py index 8d216b5c6f0..de0f901be3b 100644 --- a/homeassistant/components/logbook/__init__.py +++ b/homeassistant/components/logbook/__init__.py @@ -647,7 +647,7 @@ def _augment_data_with_context( return attr_entity_id = event_data.get(ATTR_ENTITY_ID) - if not attr_entity_id or ( + if not isinstance(attr_entity_id, str) or ( event_type in SCRIPT_AUTOMATION_EVENTS and attr_entity_id == entity_id ): return