Add heartbeat to websocket connections (#11298)

This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2017-12-26 10:59:41 +01:00
1 parent d687bc073e
commit 7a600ea064
2 files changed
+2 -2

No files matched your search

+1 -1
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)
})
+1 -1
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")