Fixed incorrect event-order (#4605)

pull/3369/merge
Daniel Perna 2016-11-28 07:29:21 +01:00 committed by Paulus Schoutsen
parent 9db1ff8cd4
commit 77d568dc47
1 changed files with 4 additions and 3 deletions

View File

@ -139,7 +139,8 @@ class LogbookView(HomeAssistantView):
def get_results(): def get_results():
"""Query DB for results.""" """Query DB for results."""
events = recorder.get_model('Events') events = recorder.get_model('Events')
query = recorder.query('Events').filter( query = recorder.query('Events').order_by(
events.time_fired).filter(
(events.time_fired > start_day) & (events.time_fired > start_day) &
(events.time_fired < end_day)) (events.time_fired < end_day))
events = recorder.execute(query) events = recorder.execute(query)