From 3c58729a4d2a279713b4a59e92d1760a24a6679b Mon Sep 17 00:00:00 2001 From: Mike Gray Date: Thu, 23 May 2024 23:20:38 -0500 Subject: [PATCH] fix: set an explicit websockets connection timeout Cuts it in half from the default of 10. Closes #40 --- ovos_PHAL_plugin_homeassistant/logic/socketclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovos_PHAL_plugin_homeassistant/logic/socketclient.py b/ovos_PHAL_plugin_homeassistant/logic/socketclient.py index 8beb352..8c03055 100644 --- a/ovos_PHAL_plugin_homeassistant/logic/socketclient.py +++ b/ovos_PHAL_plugin_homeassistant/logic/socketclient.py @@ -46,7 +46,7 @@ async def authenticate(self): async def _connect(self): try: uri = f"{self.url}/api/websocket" - self.websocket = await websockets.connect(uri) + self.websocket = await websockets.connect(uri=uri, close_timeout=5, open_timeout=5) # Wait for the auth_required message message = await self.websocket.recv()