Skip to content

Recover Sonos player after stale host failures#260

Open
msgerbush wants to merge 6 commits into
bug/playback-failure-session-statefrom
bug/sonos-stale-ip-recovery
Open

Recover Sonos player after stale host failures#260
msgerbush wants to merge 6 commits into
bug/playback-failure-session-statefrom
bug/sonos-stale-ip-recovery

Conversation

@msgerbush
Copy link
Copy Markdown
Collaborator

@msgerbush msgerbush commented May 13, 2026

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 Room at 192.168.1.24 after the speaker moved to 192.168.1.25. A later pause() attempted to contact the old host and failed with No route to host.

This change adds Sonos adapter recovery for transport failures. When play, pause, resume, or stop fails 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

  • Add SonosPlaybackTarget and SonosPlaybackTargetResolver as the recovery boundary.
  • Teach DefaultSonosService to resolve a playback target back into a runtime Sonos group.
  • Wire the playback target resolver through build_jukebox().
  • Cache the speaker name from get_speaker_info() so command logging does not trigger a networked player_name lookup.
  • Replace the old UPnP decorator with shared command execution that handles recovery while preserving known UPnP error logging.
  • Add coverage for stale-IP recovery, failed recovery, DI wiring, playback target resolution, and UPnP error handling.

@msgerbush msgerbush requested a review from Gudsfile May 13, 2026 03:36
@msgerbush msgerbush changed the title Bug/sonos stale ip recovery Recover Sonos player after stale host failures May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant