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

@@ -175,6 +175,8 @@ class LmntTTSService(InterruptibleTTSService):
async def _connect(self):
"""Connect to LMNT WebSocket and start receive task."""
await super()._connect()
await self._connect_websocket()
if self._websocket and not self._receive_task:
@@ -182,6 +184,8 @@ class LmntTTSService(InterruptibleTTSService):
async def _disconnect(self):
"""Disconnect from LMNT WebSocket and clean up tasks."""
await super()._disconnect()
if self._receive_task:
await self.cancel_task(self._receive_task)
self._receive_task = None