Fix set volume level (#31731)

afsapi requires an `int` in the 0-20 range but we receive a `float` in the 0.0-1.0 range so we have to cast and offset it
pull/31739/head
Massimiliano Cannarozzo 2020-02-11 22:10:33 +01:00 committed by GitHub
parent 3435281bd1
commit 15ed086ed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -275,7 +275,7 @@ class AFSAPIDevice(MediaPlayerDevice):
async def async_set_volume_level(self, volume):
"""Set volume command."""
await self.fs_device.set_volume(volume)
await self.fs_device.set_volume(int(volume * 20))
async def async_select_source(self, source):
"""Select input source."""