From f479f156b99acb4d18eb2022584cd930222c643f Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 6 Apr 2026 06:56:34 -0700 Subject: [PATCH] fix: use getattr for ws.closed compatibility with websockets API Co-Authored-By: Claude Opus 4.6 (1M context) --- relay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay.py b/relay.py index 018b6c4..eee5cf7 100644 --- a/relay.py +++ b/relay.py @@ -237,7 +237,7 @@ class Relay: async def _on_speaker_frame(self, pcm_bytes): """Receive speaker PCM from bridge, resample, encode Opus, send to ESP32.""" - if not self.ws or self.ws.closed: + if not self.ws or getattr(self.ws, 'closed', False): return try: self._audio_out_count += 1