Catch when old entity can't be serialized in Google Report State (#41916)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
9e9f841f35
commit
62343f87ad
1 changed files with 8 additions and 2 deletions
|
@ -45,8 +45,14 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig
|
||||||
old_entity = GoogleEntity(hass, google_config, old_state)
|
old_entity = GoogleEntity(hass, google_config, old_state)
|
||||||
|
|
||||||
# Only report to Google if data that Google cares about has changed
|
# Only report to Google if data that Google cares about has changed
|
||||||
|
try:
|
||||||
if entity_data == old_entity.query_serialize():
|
if entity_data == old_entity.query_serialize():
|
||||||
return
|
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)
|
_LOGGER.debug("Reporting state for %s: %s", changed_entity, entity_data)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue