Recover Sonos player after stale host failures#260
Open
msgerbush wants to merge 6 commits into
Open
Conversation
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 #258
Depends on #259
This PR completes recovery for the stale Sonos host issue. In the reported failure, jukebox held onto a SoCo object for
Living Roomat192.168.1.24after the speaker moved to192.168.1.25. A laterpause()attempted to contact the old host and failed withNo route to host.This change adds Sonos adapter recovery for transport failures. When
play,pause,resume, orstopfails because the current Sonos object is unreachable, the adapter re-resolves the saved playback target, switches to the newly resolved coordinator host, rebuilds the ShareLink plugin, and retries the command once.Changes
SonosPlaybackTargetandSonosPlaybackTargetResolveras the recovery boundary.DefaultSonosServiceto resolve a playback target back into a runtime Sonos group.build_jukebox().get_speaker_info()so command logging does not trigger a networkedplayer_namelookup.