Fix logbook filtering entities (#18721)

* Fix logbook filtering entities

* Fix flaky test
This commit is contained in:
Paulus Schoutsen authored and Paulus Schoutsen committed 2018-11-27 20:16:32 +01:00
1 parent 775c909a8c
commit f3047b9c03
2 files changed
+9 -3

No files matched your search

+6
View File
@@ -62,6 +62,12 @@ class TestComponentLogbook(unittest.TestCase):
# Our service call will unblock when the event listeners have been
# scheduled. This means that they may not have been processed yet.
self.hass.block_till_done()
self.hass.data[recorder.DATA_INSTANCE].block_till_done()
events = list(logbook._get_events(
self.hass, {}, dt_util.utcnow() - timedelta(hours=1),
dt_util.utcnow() + timedelta(hours=1)))
assert len(events) == 2
assert 1 == len(calls)
last_call = calls[-1]