mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Add heartbeat to websocket connections (#11298)
This commit is contained in:
parent
d687bc073e
commit
7a600ea064
@ -78,7 +78,7 @@ class CloudIoT:
|
|||||||
yield from hass.async_add_job(auth_api.check_token, self.cloud)
|
yield from hass.async_add_job(auth_api.check_token, self.cloud)
|
||||||
|
|
||||||
self.client = client = yield from session.ws_connect(
|
self.client = client = yield from session.ws_connect(
|
||||||
self.cloud.relayer, headers={
|
self.cloud.relayer, heartbeat=55, headers={
|
||||||
hdrs.AUTHORIZATION:
|
hdrs.AUTHORIZATION:
|
||||||
'Bearer {}'.format(self.cloud.id_token)
|
'Bearer {}'.format(self.cloud.id_token)
|
||||||
})
|
})
|
||||||
|
@ -263,7 +263,7 @@ class ActiveConnection:
|
|||||||
def handle(self):
|
def handle(self):
|
||||||
"""Handle the websocket connection."""
|
"""Handle the websocket connection."""
|
||||||
request = self.request
|
request = self.request
|
||||||
wsock = self.wsock = web.WebSocketResponse()
|
wsock = self.wsock = web.WebSocketResponse(heartbeat=55)
|
||||||
yield from wsock.prepare(request)
|
yield from wsock.prepare(request)
|
||||||
self.debug("Connected")
|
self.debug("Connected")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user