From 65de739489fa197681a0971a7bbb9b03c438218c Mon Sep 17 00:00:00 2001 From: milanvo Date: Wed, 4 Oct 2017 14:13:58 +0200 Subject: [PATCH] Fix restore state by filter out null value row from DB query (#9690) --- homeassistant/components/history.py | 1 + 1 file changed, 1 insertion(+) diff --git a/homeassistant/components/history.py b/homeassistant/components/history.py index 5904a99e43c..4f51abf8973 100644 --- a/homeassistant/components/history.py +++ b/homeassistant/components/history.py @@ -41,6 +41,7 @@ def last_recorder_run(hass): with session_scope(hass=hass) as session: res = (session.query(RecorderRuns) + .filter(RecorderRuns.end.isnot(None)) .order_by(RecorderRuns.end.desc()).first()) if res is None: return None