-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revise volume logic #65
Conversation
Yes, I call I am running to catch up on these changes and should have been following more closely. Can I just replace my calls to The new methods look good, I can use |
If you were using ‘absolute’ you should change to the new method. The old code attempted to scale for ‘db’ endpoints - but wasn’t always tight. |
Thus far testing is succeeding using Is there a reason why you did not leave |
It depends on your endpoints. If you have endpoints that have the volume of 0 to 100 that the two calls are the same. However many roon endpoints have the range -80 to 0 (in db) - so the old However some endpoints are neither 0/100 nor -80/0 and some -80/0 endpoints don'r have the 'db' type. In those case it would mess up - sometimes badly! So the So I expect you'll just want to use Unless you want your users to know what endpoint they are dealing with (and eg use -40 for half volume on a db endpoint) - in which case |
My tests are looking good. No issues uncovered thus far with either the new volume methods or the new WebSocket library. Installs of new or upgraded RoonCommandLine packages will upgrade or install the latest Python I'm happy with these changes. I will handle the hopefully infrequent user who upgrades roonapi but not RoonCommandLine. |
Thanks for this. the consequences of using the new code on a db endpoint could have the effect of maxing out the volume. So an error probably is safer. |
This PR refactors the pyroon volume logic.
It removes a db to percentage conversation from the
change_volume
method - which made some assumptions about roon endpoints that weren't always correct. Because of that this is a breaking change - so I've renamed the methodchange_volume_raw
to make it more obvious.I've also added three new methods to get, set and increment/decrement the volume on a percentage basis - which use the additional data roon provides about endpoints. These methods are based on code from @juliusvaart (thanks).
@juliusvaart also found that the 'type: db' parameter isn't always set for endpoints that are scaled in db - so this new logic avoids depending on this!
I've also added some simple tests - but they require a roon core (and are dependant on my setup) - so can't be run on github.
@juliusvaart could you take a look?
@doctorfree when released this may require some (small) changes to your code.
Closes #55