Skip to content

Commit

Permalink
fix: simplify ssl verify flag in WebSocket class (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Aug 9, 2024
1 parent a77dc84 commit c36e19a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/uiprotect/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ def _state_changed(self, state: WebsocketState) -> None:
async def _websocket_inner_loop(self, url: URL) -> None:
_LOGGER.debug("Connecting WS to %s", url)
await self._attempt_auth(False)
ssl = True if self.verify else False
msg: WSMessage | None = None
self._seen_non_close_message = False
session = await self._get_session()
# catch any and all errors for Websocket so we can clean up correctly
try:
self._ws_connection = await session.ws_connect(
url, ssl=ssl, headers=self._headers, timeout=self.timeout
url, ssl=self.verify, headers=self._headers, timeout=self.timeout
)
while True:
msg = await self._ws_connection.receive(self.receive_timeout)
Expand Down

0 comments on commit c36e19a

Please sign in to comment.