Skip to content

Commit

Permalink
Add CLOSED as an expected type (home-assistant#83180)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Dec 3, 2022
1 parent 6cef376 commit 0dfc0af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/websocket_api/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def handle_hass_stop(event: Event) -> None:
disconnect_warn = "Did not receive auth message within 10 seconds"
raise Disconnect from err

if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING):
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSED, WSMsgType.CLOSING):
raise Disconnect

if msg.type != WSMsgType.TEXT:
Expand All @@ -238,7 +238,7 @@ def handle_hass_stop(event: Event) -> None:
while not wsock.closed:
msg = await wsock.receive()

if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING):
if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSED, WSMsgType.CLOSING):
break

if msg.type != WSMsgType.TEXT:
Expand Down

0 comments on commit 0dfc0af

Please sign in to comment.