Skip to content

Commit

Permalink
Use legacy websockets client
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-th committed Nov 17, 2024
1 parent f3549a0 commit 3b88e61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/homematicip/aio/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import aiohttp
import async_timeout
import websockets
from websockets.legacy.client import connect
from websockets import ConnectionClosed

from homematicip.base.base_connection import (
Expand Down Expand Up @@ -112,7 +112,7 @@ async def api_call(self, path, body=None, full_url=False):
async def _connect_to_websocket(self):
try:
self.socket_connection = await asyncio.wait_for(
websockets.connect(
connect(
self._urlWebSocket,
extra_headers={
ATTR_AUTH_TOKEN: self._auth_token,
Expand Down
4 changes: 2 additions & 2 deletions tests/aio_tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def serve(self):
self._add_route()
self.runner = web.AppRunner(self.app)
await self.runner.setup()
site = web.TCPSite(self.runner, "127.0.0.1", 8123)
site = web.TCPSite(self.runner, "127.0.0.1", 34567)
await site.start()
pass

Expand Down Expand Up @@ -133,7 +133,7 @@ async def single_message_server():
@pytest.fixture
async def client_connection(event_loop):
connection = AsyncConnection(event_loop)
connection._urlWebSocket = "ws://localhost:8123/"
connection._urlWebSocket = "ws://localhost:34567/"
connection.ping_timeout = 1
yield connection

Expand Down

0 comments on commit 3b88e61

Please sign in to comment.