Move websocket connection to background tasks (5-minute HA startup hang) - #43
Open
proscar87 wants to merge 1 commit into
Open
Move websocket connection to background tasks (5-minute HA startup hang)#43proscar87 wants to merge 1 commit into
proscar87 wants to merge 1 commit into
Conversation
Switches WebSocket connections to prevent HA hanging on startup until the startup wrap timeouts. This would hang the startup process as described in issue Connectlife-LLC#28 bug 1. (cherry picked from commit b247df6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Bug 1 of #28:
HisenseWebSocket._connect_ws()runs in the setup path and can hang until Home Assistant's 5-minute setup timeout, blocking all integrations from completing startup. Several users report removing the integration because of this (see #28 thread); on my instance all 7 ACs came upunavailableafter a restart with this signature.The connect logic moves into a retrying background task (
_connect_ws_loop) so setup returns immediately and the socket (re)connects out of band.Credit
This is @bsantelicesm's fix, cherry-picked with authorship preserved from their fork (offered in the #28 thread in June, never PR'd). Upstreaming so it reaches HACS users.
Related symptom reports: #25 (periodic unavailable), #33, #17.
🤖 Upstreamed with Claude Code