Open
Conversation
|
Thanks for trying to fix https://github.com/orgs/music-assistant/discussions/3288 Was wondering, would it be possible to implement also a option to scale the volume ? Something like this:
|
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.


FRONTEND CHANGES: music-assistant/frontend#1569
Satisifies: https://github.com/orgs/music-assistant/discussions/3288
Add configurable min/max volume limits per player
Summary
Edge cases and functionality covered
cmd_volume_set — All explicit volume set commands are clamped to [min_volume, max_volume] before reaching the device, including when called programmatically or via API.
cmd_volume_up / cmd_volume_down — Step-based volume changes respect the limits.
volume_upcaps atmax_volumeinstead of 100;volume_downfloors atmin_volumeinstead of 0.External volume changes — When a device reports a volume change outside the allowed range (e.g. user pressed a physical volume button, or used a manufacturer app), the controller detects it in
signal_player_state_updateand fires a correctivecmd_volume_setto clamp it back.Group volume — When adjusting group volume, each child player's individual min/max limits are respected. One child with max=50 won't be pushed to 80 just because the group volume goes up.
Config validation —
on_player_config_changevalidates thatmin_volume<=max_volumeand raisesInvalidDataErrorif notFalsy value handling — Uses explicit is not
Nonechecks rather than truthiness when reading config values, somin_volume=0(a valid and common default) isn't incorrectly treated as missing.Frontend exposure —
extra_attributesproperty conditionally includesmin_volumeandmax_volumeonly when they differ from defaults (0 and 100), so the frontend/HA integration can render appropriate slider bounds without noise in the default case.Advanced settings — Both config entries are marked as advanced so they don't clutter the basic player settings for users who don't need them.
Default behavior unchanged — With defaults of min=0 and max=100, all existing behavior is preserved.