Skip to content

Commit

Permalink
More linting
Browse files Browse the repository at this point in the history
revenu à full_ws_url pour garder le même nom que le code original
  • Loading branch information
ic-dev21 committed Nov 27, 2024
1 parent fb35d87 commit 70cc6bb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pyhilo/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ async def _async_send_json(self, payload: dict[str, Any]) -> None:
def _parse_message(self, msg: dict[str, Any]) -> None:
"""Parse an incoming message."""
if self._api.log_traces:
LOG.debug(f"[TRACE] Received message on websocket {self._api.endpoint}: {msg}")
LOG.debug(
f"[TRACE] Received message on websocket {self._api.endpoint}: {msg}"
)
if msg.get("type") == SignalRMsgType.PING:
schedule_callback(self._async_pong)
return
Expand Down Expand Up @@ -269,7 +271,7 @@ async def async_connect(self) -> None:

LOG.info("Websocket: Connecting to server %s", self._api.endpoint)
if self._api.log_traces:
LOG.debug(f"[TRACE] Websocket URL: {self._api.full_url}")
LOG.debug(f"[TRACE] Websocket URL: {self._api.full_ws_url}")
headers = {
"Sec-WebSocket-Extensions": "permessage-deflate; client_max_window_bits",
"Pragma": "no-cache",
Expand All @@ -287,7 +289,7 @@ async def async_connect(self) -> None:
try:
self._client = await self._api.session.ws_connect(
URL(
self._api.full_url,
self._api.full_ws_url,
encoded=True,
),
heartbeat=55,
Expand Down Expand Up @@ -392,7 +394,7 @@ class WebsocketConfig:
url: Optional[str] = None
token: Optional[str] = None
connection_id: Optional[str] = None
full_url: Optional[str] = None
full_ws_url: Optional[str] = None
log_traces: bool = True
session: ClientSession | None = None

Expand Down Expand Up @@ -504,16 +506,16 @@ async def _get_websocket_params(self, config: WebsocketConfig) -> None:
)

config.connection_id = resp.get("connectionId", "")
config.full_url = (
config.full_ws_url = (
f"{config.url}&id={config.connection_id}&access_token={config.token}"
)
LOG.debug(f"Getting full ws URL {config.full_url}")
LOG.debug(f"Getting full ws URL {config.full_ws_url}")

transport_dict = resp.get("availableTransports", [])
websocket_dict = {
"connection_id": config.connection_id,
"available_transports": transport_dict,
"full_url": config.full_url,
"full_url": config.full_ws_url,
}

# Save state
Expand Down

0 comments on commit 70cc6bb

Please sign in to comment.