From ec9b5df7b3f7446f629c647eb8bceeefc8f4d9cb Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Thu, 11 Nov 2021 06:31:56 +0000 Subject: [PATCH] Ignore None state in state_change_event (#59485) --- homeassistant/components/integration/sensor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/homeassistant/components/integration/sensor.py b/homeassistant/components/integration/sensor.py index 22e80e7879e..463cb3b4e05 100644 --- a/homeassistant/components/integration/sensor.py +++ b/homeassistant/components/integration/sensor.py @@ -155,6 +155,7 @@ class IntegrationSensor(RestoreEntity, SensorEntity): if ( old_state is None + or new_state is None or old_state.state in (STATE_UNKNOWN, STATE_UNAVAILABLE) or new_state.state in (STATE_UNKNOWN, STATE_UNAVAILABLE) ):