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,9 +139,10 @@ class LogbookView(HomeAssistantView):
def get_results():
"""Query DB for results."""
events = recorder.get_model('Events')
query = recorder.query('Events').filter(
(events.time_fired > start_day) &
(events.time_fired < end_day))
query = recorder.query('Events').order_by(
events.time_fired).filter(
(events.time_fired > start_day) &
(events.time_fired < end_day))
events = recorder.execute(query)
return _exclude_events(events, self.config)