joopert / nad_receiver

python api to connect to NAD receivers
MIT License
12 stars 18 forks source link

Fix volume #26

Closed gladhorn closed 4 years ago

gladhorn commented 4 years ago

In 5b9e7e711f18ca1f613b16231c31ac9085070e86 an attempt was made to adapt the code to support receivers that return float volumes ('-41.5') but that change made things worse, since round(string) will never work. round() takes a number, not a string.

Let's be more precise and return the volume as float. Alternatively we could do int(float(volume)) but that doesn't seem like an improvement. At least the home assistant code will deal with the change from int to float just fine.