From 57b3e8018b1d8e1829df62b5688bd1ebb4b741ee Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 31 Mar 2015 23:09:08 -0700 Subject: [PATCH] Logbook bug fixes --- .../www_static/polymer/components/logbook-entry.html | 3 ++- homeassistant/components/logbook.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/frontend/www_static/polymer/components/logbook-entry.html b/homeassistant/components/frontend/www_static/polymer/components/logbook-entry.html index e454fee9ed7..6d5bd917fb5 100644 --- a/homeassistant/components/frontend/www_static/polymer/components/logbook-entry.html +++ b/homeassistant/components/frontend/www_static/polymer/components/logbook-entry.html @@ -50,7 +50,8 @@ var uiActions = window.hass.uiActions; Polymer({ - entityClicked: function() { + entityClicked: function(ev) { + ev.preventDefault(); uiActions.showMoreInfoDialog(this.entryObj.entityId); } }); diff --git a/homeassistant/components/logbook.py b/homeassistant/components/logbook.py index 810b06b25da..3b42ffdee57 100644 --- a/homeassistant/components/logbook.py +++ b/homeassistant/components/logbook.py @@ -39,8 +39,7 @@ def setup(hass, config): def _handle_get_logbook(handler, path_match, data): """ Return logbook entries. """ start_today = datetime.now().date() - import time - print(time.mktime(start_today.timetuple())) + handler.write_json(humanify( recorder.query_events(QUERY_EVENTS_AFTER, (start_today,)))) @@ -123,7 +122,7 @@ def humanify(events): to_state = State.from_dict(event.data.get('new_state')) - if not to_state: + if not to_state or to_state.last_changed != to_state.last_updated: continue domain = to_state.domain