Close TCP connection after synthesis so HA receives FIN and unblocks
All checks were successful
Build and Push Docker Image / build (push) Successful in 2m10s

disconnect() was a no-op in the base class; writer.close() was never
called, leaving HA waiting for a TCP FIN that never arrived.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-08 19:58:54 -04:00
parent 1cda188c98
commit 6999bcdb57

View File

@@ -83,6 +83,13 @@ class KokoroEventHandler(AsyncEventHandler):
self.config = config
self.executor = executor
async def disconnect(self) -> None:
self.writer.close()
try:
await self.writer.wait_closed()
except Exception:
pass
async def handle_event(self, event: Event) -> bool:
if Describe.is_type(event.type):
await self.write_event(self.wyoming_info.event())