Catch when old entity can't be serialized in Google Report State (#41916)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
pull/41934/head
Paulus Schoutsen 2020-10-16 09:56:48 +02:00 committed by GitHub
parent 9e9f841f35
commit 62343f87ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -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)