Track websocket disconnecting status to improve error handling

This commit is contained in:
Mark Backman
2026-01-09 16:48:51 -05:00
parent 4fe0836cf9
commit 9c81acb159
21 changed files with 102 additions and 10 deletions

View File

@@ -141,6 +141,8 @@ class GradiumSTTService(WebsocketSTTService):
pass
async def _connect(self):
await super()._connect()
await self._connect_websocket()
if self._websocket and not self._receive_task:
@@ -179,6 +181,8 @@ class GradiumSTTService(WebsocketSTTService):
raise
async def _disconnect(self):
await super()._disconnect()
if self._receive_task:
await self.cancel_task(self._receive_task)
self._receive_task = None