Conversation
|
Consider the complex of configuration and multiple chromecast device types, I am asking help for testing. When you are testing, please enable debug log. |
|
|
||
| _LOGGER.debug("Starting internal pychromecast discovery.") | ||
| listener, browser = pychromecast.start_discovery(internal_callback) | ||
| hass.bus.listen_once(EVENT_HOMEASSISTANT_START, start_discovery) |
There was a problem hiding this comment.
Why would we wait till start? That's generally a bad idea because that's when automations start, so any device discovered after that could trigger an automation.
|
Working with @awarecan on testing. Initially after a 30 min duration of a cast device being offline and replugging back in the # on the return in line 127 seemed to allow the cast device to become available again. But after a much longer test (several hours), 3 devices dropped and never came back into an available state. I provided the entire log to @awarecan. I also disagree on delaying the internal start of discovery. |
|
Many thanks to @edif30 The log was under a different version changes, not this PR, but the basic change of rediscover logic is the same thing. And I found an interesting race condition in the disconnection event, row log is At 02:21:08, this device was removed, at 02:21:36 HA aware that disconnection and start re-connection attempt. At 02:21:50, zeroconf discovered device back, HA think No connection related update: ('192.168.100.45', 8009) because the previous open socket is still reconnecting. At the exactly same second, the re-connection failed and reach the max retry and stopped. Therefore, this device is lost At 02:22:05, two other device in same multizone group received I am thinking, after the zeroconf discovered the device, the device may not be able to connect immediately, maybe we should close the previous socket no matter when we discovered new or previous device. By the way, this log was still in 3 retires version. This PR already changed the retry times to 6, hope it can workaround this particular issue. |
|
These logs are from commit 92cb07a. I did one log with the group discovery turned off and the other with it turned on. |
|
@awarecan I ended up reverting that retry back to 3 just to test with the removal of the return on line 127. I didn't see a difference between the two on long outage durations of cast devices. |
|
I changed fix. New PR is #16804. |
Description:
Overhaul the platform setup code.
Chromecast has two different way to config, zeroconf discovery or manual config the host IP. In this PR
Related issue (if applicable): fixes #13530 fixes #16686
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests pass