Skip to content
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

Round to nearest 0.5 db when setting volume #42

Merged
merged 1 commit into from
Oct 9, 2017
Merged

Conversation

sdague
Copy link
Contributor

@sdague sdague commented Oct 9, 2017

The rxv library interface passes around well understood db volumes
over it's interface, values such as -53.5db and the like. The Yamaha
API operates in terms of deci-db as an integer - i.e. 535.

However, most (if not all) Yamaha receivers have a 5 deci db
resolution, and trying to set values such as 531 cause an error. This
change makes the rxv library round all set calls up to the nearest
half db to remove these errors. These are especially triggered when
coming from Home Assistant which has it's own 0 - 100 idea of volume,
so is very often not hitting a defined db boundary.

Closes Bug #35

The rxv library interface passes around well understood db volumes
over it's interface, values such as -53.5db and the like. The Yamaha
API operates in terms of deci-db as an integer - i.e. 535.

However, most (if not all) Yamaha receivers have a 5 deci db
resolution, and trying to set values such as 531 cause an error. This
change makes the rxv library round all set calls up to the nearest
half db to remove these errors. These are especially triggered when
coming from Home Assistant which has it's own 0 - 100 idea of volume,
so is very often not hitting a defined db boundary.

Closes Bug wuub#35
@wuub
Copy link
Owner

wuub commented Oct 9, 2017

Through the power of math doing the int of * 2, then * 5 will
ensure we only get half steps.

:D

@wuub wuub merged commit e8c692b into wuub:master Oct 9, 2017
@sdague
Copy link
Contributor Author

sdague commented Oct 9, 2017

Can we get a release cut with this? It would close a Home Assistant bug.

@wuub
Copy link
Owner

wuub commented Oct 9, 2017

https://pypi.python.org/pypi/rxv/0.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants