Trying to adjust light template volume control to Yamaha receiver

Using this guide at the bottom of the page to control volume of a media player. Worked great on my Bravia television but just added a Yamaha receiver and for some reason their volume goes from 0-97. No clue why they feel the need to be different but the problem is when I have Alexa set volume to 20 she actually sets it to 16; 50 is actually 40, 60 is 48. I spitballer and changed the two spots with 100 in this line of code to 97 and it’s still off. Not sure if it’s just a matter of changing the math or what but would appreciate any help offered.

volume_level: "{{ (brightness / 255 * 100)|int / 100 }}"