Open bs42 opened 1 year ago
It looks like we are currently using the default in HA's MediaPlayerEntity: check out: https://github.com/home-assistant/core/blob/dev/homeassistant/components/media_player/__init__.py#L935
I agree that 10% volume level increases are fairly large and make it hard to find the perfect volume. 1, 2, or 3% adjustment would probably make more sense. I wonder what others think about this?
As a workaround have you considered configuring each zone's vol_min and vol_max fields to reduce the adjustable range? This would make percent changes smaller.
When I was using my home-brew REST media player before this addon was around, I had it set to 1% and it was very similar to the volume increases I have with other media devices.
I have not tried to set vol_min/vol_max, I'll take a look at that for a short term fix.
I added a 1% step size to a branch on my fork but haven't had a chance to test it yet: https://github.com/linknum23/hacs_amplipi/tree/vol_step_size
I copied that file over into my custom_components and restarted HA, but it still does 10%. I wonder if there is something that has to be registered for HA to know the vol functions are available that's missing.
Thanks for testing it out. I will check back see if there's something I missed in how this works.
On Wed, Mar 1, 2023 at 10:49 AM bs42 @.***> wrote:
I copied that file over into my custom_components and restarted HA, but it still does 10%. I wonder if there is something that has to be registered for HA to know the vol functions are available that's missing.
— Reply to this email directly, view it on GitHub https://github.com/brianhealey/hacs_amplipi/issues/13#issuecomment-1450375088, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEZPO7IEQCE4NRUAZQGGKDWZ5VWZANCNFSM6AAAAAAVJ52PWY . You are receiving this because you commented.Message ID: @.***>
Just searching for help on this led me to the mini-media-player. It looks like it has a configurable volume step size:
Name | Type | Default | Since | Description |
---|---|---|---|---|
volume_step | number | optional | v1.9.0 | Change the volume step size of the volume buttons and the volume slider (number between 1 - 100)1. |
If we can't override this behavior easily using that media player with this configuration might be a simpler route.
I found it, the vol options were added to the AmpliPiSource class instead of the AmpliPiZone class. I updated a few things in there, so I'll confirm exactly which item 100% fixed it and give you a patch for it.
Done, I've never done a pull request into a branch on a fork before so fingers crossed I did that right.
Can we get the volume control updated? Currently the slider is the only way to control the volume when you are in the interface, if you use the +/- buttons it jumps by 10 instead of 1.
I believe the
volume_up
andvolume_down
methods need to be implemented in the interface to HA to fix that and then those would send the proper increment.