From 57f4f061a6b3f1cc77375dc88cf05abecd2da067 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 5 Feb 2024 01:55:19 -0600 Subject: [PATCH] Use identity check in hassio websocket ingress (#109672) --- homeassistant/components/hassio/ingress.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/hassio/ingress.py b/homeassistant/components/hassio/ingress.py index 4f3933d0f5c..499a83b0444 100644 --- a/homeassistant/components/hassio/ingress.py +++ b/homeassistant/components/hassio/ingress.py @@ -288,13 +288,13 @@ async def _websocket_forward( """Handle websocket message directly.""" try: async for msg in ws_from: - if msg.type == aiohttp.WSMsgType.TEXT: + if msg.type is aiohttp.WSMsgType.TEXT: await ws_to.send_str(msg.data) - elif msg.type == aiohttp.WSMsgType.BINARY: + elif msg.type is aiohttp.WSMsgType.BINARY: await ws_to.send_bytes(msg.data) - elif msg.type == aiohttp.WSMsgType.PING: + elif msg.type is aiohttp.WSMsgType.PING: await ws_to.ping() - elif msg.type == aiohttp.WSMsgType.PONG: + elif msg.type is aiohttp.WSMsgType.PONG: await ws_to.pong() elif ws_to.closed: await ws_to.close(code=ws_to.close_code, message=msg.extra) # type: ignore[arg-type]