Kodi Application.SetVolume() expects an integer or a string, not a float

This commit is contained in:
Fabio Manganiello 2019-07-25 23:54:32 +02:00
parent e208166a92
commit 0ab70cdbae

View file

@ -309,7 +309,7 @@ class MediaKodiPlugin(MediaPlugin):
volume = self._get_kodi().Application.GetProperties(
properties=['volume']).get('result', {}).get('volume')
result = self._get_kodi().Application.SetVolume(volume=min(volume+step, 100))
result = self._get_kodi().Application.SetVolume(volume=int(min(volume+step, 100)))
return self._build_result(result)
@action
@ -318,7 +318,7 @@ class MediaKodiPlugin(MediaPlugin):
volume = self._get_kodi().Application.GetProperties(
properties=['volume']).get('result', {}).get('volume')
result = self._get_kodi().Application.SetVolume(volume=max(volume-step, 0))
result = self._get_kodi().Application.SetVolume(volume=int(max(volume-step, 0)))
return self._build_result(result)
@action
@ -330,7 +330,7 @@ class MediaKodiPlugin(MediaPlugin):
:type volume: int
"""
result = self._get_kodi().Application.SetVolume(volume=volume)
result = self._get_kodi().Application.SetVolume(volume=int(volume))
return self._build_result(result)
@action