From 62343f87ada449b1944caa659d2ec4bc3dc0e492 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 16 Oct 2020 09:56:48 +0200 Subject: [PATCH] Catch when old entity can't be serialized in Google Report State (#41916) Co-authored-by: Martin Hjelmare --- .../components/google_assistant/report_state.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/google_assistant/report_state.py b/homeassistant/components/google_assistant/report_state.py index 6fc9de53e4a..8ffdad14140 100644 --- a/homeassistant/components/google_assistant/report_state.py +++ b/homeassistant/components/google_assistant/report_state.py @@ -45,8 +45,14 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig old_entity = GoogleEntity(hass, google_config, old_state) # Only report to Google if data that Google cares about has changed - if entity_data == old_entity.query_serialize(): - return + try: + if entity_data == old_entity.query_serialize(): + return + except SmartHomeError: + # Happens if old state could not be serialized. + # In that case the data is different and should be + # reported. + pass _LOGGER.debug("Reporting state for %s: %s", changed_entity, entity_data)