fix: use getattr for ws.closed compatibility with websockets API
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4eac803699
commit
f479f156b9
2
relay.py
2
relay.py
|
|
@ -237,7 +237,7 @@ class Relay:
|
||||||
|
|
||||||
async def _on_speaker_frame(self, pcm_bytes):
|
async def _on_speaker_frame(self, pcm_bytes):
|
||||||
"""Receive speaker PCM from bridge, resample, encode Opus, send to ESP32."""
|
"""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
|
return
|
||||||
try:
|
try:
|
||||||
self._audio_out_count += 1
|
self._audio_out_count += 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue