From 5a0251c3cd99e7aa937ef55de64bc4d4c186cfe0 Mon Sep 17 00:00:00 2001
From: Paulus Schoutsen <paulus@paulusschoutsen.nl>
Date: Fri, 27 Mar 2015 23:11:07 -0700
Subject: [PATCH] ps: Fix recorder.py fetching wrong run information

---
 homeassistant/components/recorder.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/homeassistant/components/recorder.py b/homeassistant/components/recorder.py
index 84d4c1ecccd..367af7d2d73 100644
--- a/homeassistant/components/recorder.py
+++ b/homeassistant/components/recorder.py
@@ -86,7 +86,7 @@ def run_information(point_in_time=None):
         return RecorderRun()
 
     run = _INSTANCE.query(
-        "SELECT * FROM recorder_runs WHERE start>? AND END IS NULL OR END<?",
+        "SELECT * FROM recorder_runs WHERE start<? AND END>?",
         (point_in_time, point_in_time), return_value=RETURN_ONE_ROW)
 
     return RecorderRun(run) if run else None
-- 
GitLab