Add retry limit for chromecast connection#16471
Merged
balloob merged 1 commit intohome-assistant:devfrom Sep 12, 2018
Merged
Conversation
Member
|
Tried it locally and it works. |
OttoWinter
reviewed
Sep 19, 2018
| cast_info.host, cast_info.port, cast_info.uuid, | ||
| cast_info.model_name, cast_info.friendly_name | ||
| )) | ||
| ), CONNECTION_RETRY, CONNECTION_RETRY_WAIT, CONNECTION_TIMEOUT) |
Member
There was a problem hiding this comment.
Just saw this PR while working through my mailbox. Before a chromecast rewrite it was done like with your new code. However, the problem with this change is that if the retry limit is exceeded (for example by plugging the CC out for a while), hass will no longer attempt to reconnect.
Anyway, I guess the only way to get rid of all these CC issues is to make pychromecast a bit more async aware. Either by converting it to asyncio (lots of work, trust me I tried) or by making use of the blocking parameter.
2 tasks
awarecan
added a commit
to awarecan/home-assistant
that referenced
this pull request
Sep 23, 2018
awarecan
added a commit
to awarecan/home-assistant
that referenced
this pull request
Sep 23, 2018
balloob
pushed a commit
that referenced
this pull request
Sep 23, 2018
* Revert changes of #16471, and fix the platform setup issue * Fix unit test * Fix * Fix comment * Fix test * Address review comment * Address review comment
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description:
Connect to chromecast fail will block whole HA startup
_get_chromecast_from_hostmethod accepttries,retry_wait,timeoutandblockingparameters. But above code doesn't provided any one of them.timeoutdefault is 30s, and tries default isinfinite.I don't have chromecast, need someone help to test this PR
Related issue (if applicable): fixes #14956
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices: