/
/
/
# What does this implement/fix? When a player uses the "fake" mute control, muting is simulated by turning the volume down to zero and remembering the volume so it can be put back on unmute. Two things went wrong there: - An unmute for a player that was not muted at all still forced its volume down to 1. This is easy to hit: unmuting a group sends an unmute to every member, muted or not, and Home Assistant scripts and voice assistants happily send an unmute unconditionally. - If the player's volume was still unknown at mute time, nothing usable was remembered and the unmute failed with an error instead of restoring the sound. Players can legitimately report an unknown volume (MusicCast, Sendspin and DLNA all do so while the device has not reported its volume yet). Neither was reported by a user, hence the maintenance label. **Related issue (if applicable):** - n/a ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives the label from the ticked box and applies it automatically; the release-notes generator uses that same label to slot this change into the next release notes. --> - [ ] 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` - [x] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` Changes: - An unmute now only restores a volume if the player was actually muted through the fake mute control. - Fall back to a low volume when the player's volume was unknown at mute time. - Added regression tests for both cases, plus one covering a player that was already silent. ## 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.