Guard logbook assuming entity ID is a string (#50047)

This commit is contained in:
Paulus Schoutsen 2021-05-04 14:23:22 -07:00 committed by GitHub
parent 98ef1e1e82
commit 4cf910affc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -647,7 +647,7 @@ def _augment_data_with_context(
return return
attr_entity_id = event_data.get(ATTR_ENTITY_ID) 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 event_type in SCRIPT_AUTOMATION_EVENTS and attr_entity_id == entity_id
): ):
return return