Port to the websockets asyncio implementation, support for websockets 13 and 14

This commit is contained in:
Mark Backman
2025-07-22 17:23:55 -04:00
parent 7955080da2
commit 300f19ad23
19 changed files with 94 additions and 68 deletions

View File

@@ -43,7 +43,7 @@ class WebsocketService(ABC):
True if connection is verified working, False otherwise.
"""
try:
if not self._websocket or self._websocket.closed:
if not self._websocket or self._websocket.state is State.CLOSED:
return False
await self._websocket.ping()
return True
@@ -82,7 +82,7 @@ class WebsocketService(ABC):
try:
await self._receive_messages()
retry_count = 0 # Reset counter on successful message receive
if self._websocket and self._websocket.state == State.CLOSED:
if self._websocket and self._websocket.state is State.CLOSED:
raise websockets.ConnectionClosedOK(
self._websocket.close_rcvd,
self._websocket.close_sent,