Repository navigation
Stream sync: update sync_id only when the station is playing (fixes #835, regression from #819) - #836
Merged
AlexxIT merged 2 commits intoOct 8, 2026
Conversation
AlexxIT
approved these changes
Oct 8, 2026
Owner
|
Спасибо! |
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.
Problem
v3.22.1 fixed #819 by checking
data["state"]["playing"]before callingsync_play_media(). Butsync_idis still updated unconditionally, even when the station is not playing.At a track boundary the station first reports the new track id in
pausedstate and only thenplaying. With the current code:paused, new id →sync_idis updated, nosync_play_media(correct so far)playing, same id →sync_id == player_state["id"]→ onlymedia_playis sentSo the external player resumes the previous track instead of starting the new one, and then goes silent. Reported in #819 (comment by @sghnsk, Станция Мини 2 → mpd/umpdcli) and in #835 (Станция Макс → Sonos Arc Ultra, HA 2026.9.4, v3.22.1).
Fix
Update
sync_idonly together with starting playback, i.e. only when the station isplaying:A new id received in
pausedstate is ignored; when the station switches toplayingthe id still differs fromsync_id, so the new track is sent. #819 stays fixed: an id change while paused does not restart the track; on resume with the same idmedia_playis sent, with a different id the new track is started.Tested
media_players, HA 2026.9.4: before — 2/2 track changes reproduced the "previous track resumes" symptom; with this logic — 6/6 track changes play the correct track, pause/resume (Музыка возвращается на внешнюю колонку через 6–8 секунд после паузы (Станция Макс 2020) #819 scenario) OK, no repeat.