Frontend: stream fires ping on connect
This is needed for Safari/Firefox to call onOpen
This commit is contained in:
1 parent
ff4c3f791c
commit
89f59a758d
4 files changed
+26
-8
No files matched your search
@@ -126,13 +126,13 @@ def _handle_get_api_stream(handler, path_match, data):
|
||||
hass.bus.listen(MATCH_ALL, forward_events)
|
||||
|
||||
while True:
|
||||
write_message(STREAM_PING_PAYLOAD)
|
||||
|
||||
block.wait(STREAM_PING_INTERVAL)
|
||||
|
||||
if block.is_set():
|
||||
break
|
||||
|
||||
write_message(STREAM_PING_PAYLOAD)
|
||||
|
||||
if not gracefully_closed:
|
||||
_LOGGER.info("Found broken event stream to %s, cleaning up",
|
||||
handler.client_address[0])
|
||||
|
||||
Reference in new issue
Block a user