refactor: connection check & reconnection handling#36
Merged
Conversation
- Check internal AndroidTV protocol state before sending a command. - Force a reconnect if the internal state indicates a broken connection. - Use a decorator to handle connection check and error handling. - Handle auth errors and allow to pair again in the setup flow. - Devices with auth error are prefixes with ! in the device dropdown. - Increase connection timeout to 10 seconds.
af3c2db to
b9e6d9e
Compare
Centralize certificate handling and migration in Devices configuration class. Introduce more device states and error checks. Fixes #37
If a device requires pairing, the setup flow creates a new client certificate and reconnects the configured device.
The same Android TV device can only be controlled by multiple clients if their client name is different. Otherwise, the old client certificate is no longer valid and only the last paired client can control the device! Instead of using a hardcoded client name, use the hostname with an optional override with ENV variable `UC_CLIENT_NAME`. Fixes #39
53f7d23 to
be38d8b
Compare
zehnm
commented
Apr 1, 2024
zehnm
left a comment
Contributor
Author
There was a problem hiding this comment.
Tested with Google Chromecast HD and NVIDIA Shield 2017 & 2019
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.
Improved Android TV device connection & reconnection logic with various fixes.
Fixes #28
Other fixes:
If a device requires pairing, the setup flow creates a new client certificate and then successfully reconnects the configured device.
Fixes Certificate file migration in multi-instance handling doesn't work from last release version 0.4.6 #37
UC_CLIENT_NAMEENV var as override.Fixes Same Android TV device cannot be controlled by multiple Remote Two devices #39