Add heartbeat to websocket connections (#11298)

pull/11302/merge
Paulus Schoutsen 2017-12-26 01:59:41 -08:00 committed by Pascal Vizeli
parent d687bc073e
commit 7a600ea064
2 changed files with 2 additions and 2 deletions

View File

@ -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)
})

View File

@ -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")