Add heartbeat to websocket connections (#11298)
parent
d687bc073e
commit
7a600ea064
|
@ -78,7 +78,7 @@ class CloudIoT:
|
|||
yield from hass.async_add_job(auth_api.check_token, self.cloud)
|
||||
|
||||
self.client = client = yield from session.ws_connect(
|
||||
self.cloud.relayer, headers={
|
||||
self.cloud.relayer, heartbeat=55, headers={
|
||||
hdrs.AUTHORIZATION:
|
||||
'Bearer {}'.format(self.cloud.id_token)
|
||||
})
|
||||
|
|
|
@ -263,7 +263,7 @@ class ActiveConnection:
|
|||
def handle(self):
|
||||
"""Handle the websocket connection."""
|
||||
request = self.request
|
||||
wsock = self.wsock = web.WebSocketResponse()
|
||||
wsock = self.wsock = web.WebSocketResponse(heartbeat=55)
|
||||
yield from wsock.prepare(request)
|
||||
self.debug("Connected")
|
||||
|
||||
|
|
Loading…
Reference in New Issue