From 900714a3eea3f2e1d8621870041be707436ed2d4 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 25 Feb 2020 09:05:36 -0800 Subject: [PATCH] Do not report state when closing down (#32168) --- homeassistant/components/alexa/state_report.py | 3 +++ homeassistant/components/google_assistant/report_state.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/homeassistant/components/alexa/state_report.py b/homeassistant/components/alexa/state_report.py index 44e1b7f4f55..b595bc98589 100644 --- a/homeassistant/components/alexa/state_report.py +++ b/homeassistant/components/alexa/state_report.py @@ -26,6 +26,9 @@ async def async_enable_proactive_mode(hass, smart_home_config): await smart_home_config.async_get_access_token() async def async_entity_state_listener(changed_entity, old_state, new_state): + if not hass.is_running: + return + if not new_state: return diff --git a/homeassistant/components/google_assistant/report_state.py b/homeassistant/components/google_assistant/report_state.py index 1e8b6c020de..d6bcafd3bff 100644 --- a/homeassistant/components/google_assistant/report_state.py +++ b/homeassistant/components/google_assistant/report_state.py @@ -21,6 +21,9 @@ def async_enable_report_state(hass: HomeAssistant, google_config: AbstractConfig """Enable state reporting.""" async def async_entity_state_listener(changed_entity, old_state, new_state): + if not hass.is_running: + return + if not new_state: return