/
/
/
# What does this implement/fix? When you adjust the volume of a group, Music Assistant moves every speaker while keeping their relative balance, using a cached reference of where the speakers were. That reference was not updated when a speaker's volume was changed on the device itself (a knob, its own app, another controller), and it was also kept when a speaker dropped out of the group. Two things went wrong because of that: - You turn one speaker down by hand, then nudge the group volume up — the speaker jumps straight back up, undoing what you just did. - A speaker in a permanent group goes offline while it was the loudest one — the next group volume **up** turns the remaining speakers **down** instead. **Changes:** - A volume change coming from the speaker itself now refreshes the reference the group is adjusted from. A speaker confirming a level Music Assistant just sent it does not, so the balance is still preserved across repeated presses. - The same applies to a speaker that was corrected because it ran past its configured volume limit. - The reference is rebuilt whenever the set of speakers being adjusted changes, not only when a new one appears. - A group that reports a volume of its own (Chromecast groups do) no longer resets its own reference. - Added tests covering each case. ## Types of changes - [x] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.