Add live streaming logbook websocket endpoint (#72258)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
J. Nick Koston 2022-05-22 14:57:54 -05:00 committed by GitHub
parent 3390d62b3d
commit 9c3f949165
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 2592 additions and 733 deletions

View file

@ -75,6 +75,7 @@ from .tasks import (
RecorderTask,
StatisticsTask,
StopTask,
SynchronizeTask,
UpdateStatisticsMetadataTask,
WaitTask,
)
@ -928,6 +929,12 @@ class Recorder(threading.Thread):
if self._async_event_filter(event):
self.queue_task(EventTask(event))
async def async_block_till_done(self) -> None:
"""Async version of block_till_done."""
event = asyncio.Event()
self.queue_task(SynchronizeTask(event))
await event.wait()
def block_till_done(self) -> None:
"""Block till all events processed.