mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Add CLOSED as an expected type (#83180)
This commit is contained in:
parent
6cef37641c
commit
0dfc0af08c
@ -214,7 +214,7 @@ class WebSocketHandler:
|
|||||||
disconnect_warn = "Did not receive auth message within 10 seconds"
|
disconnect_warn = "Did not receive auth message within 10 seconds"
|
||||||
raise Disconnect from err
|
raise Disconnect from err
|
||||||
|
|
||||||
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING):
|
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSED, WSMsgType.CLOSING):
|
||||||
raise Disconnect
|
raise Disconnect
|
||||||
|
|
||||||
if msg.type != WSMsgType.TEXT:
|
if msg.type != WSMsgType.TEXT:
|
||||||
@ -238,7 +238,7 @@ class WebSocketHandler:
|
|||||||
while not wsock.closed:
|
while not wsock.closed:
|
||||||
msg = await wsock.receive()
|
msg = await wsock.receive()
|
||||||
|
|
||||||
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING):
|
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSED, WSMsgType.CLOSING):
|
||||||
break
|
break
|
||||||
|
|
||||||
if msg.type != WSMsgType.TEXT:
|
if msg.type != WSMsgType.TEXT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user