Skip to content

Commit

Permalink
refactor: use identity checks for WebSocket message types (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Jan 24, 2025
1 parent 2188bfa commit f1e9192
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/aioharmony/hubconnector_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ async def _listener(self, websocket=None) -> None:
"%s: Response payload: %s", self._ip_address, response.data
)

if response.type == aiohttp.WSMsgType.CLOSED:
if response.type is aiohttp.WSMsgType.CLOSED:
close_code = (
""
if response.data is None
Expand All @@ -383,11 +383,11 @@ async def _listener(self, websocket=None) -> None:
have_connection = False
break

if response.type == aiohttp.WSMsgType.ERROR:
if response.type is aiohttp.WSMsgType.ERROR:
_LOGGER.error("%s: Response error", self._ip_address)
continue

if response.type != aiohttp.WSMsgType.TEXT:
if response.type is not aiohttp.WSMsgType.TEXT:
continue

response_json = response.json()
Expand Down

0 comments on commit f1e9192

Please sign in to comment.