From e0e3081eb124489d0f745721a2b2be073f011113 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 28 Feb 2021 01:31:00 +0100 Subject: [PATCH] VLC volume should strictly be an integer --- platypush/plugins/media/vlc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/media/vlc.py b/platypush/plugins/media/vlc.py index 1c29924c..764b7129 100644 --- a/platypush/plugins/media/vlc.py +++ b/platypush/plugins/media/vlc.py @@ -210,14 +210,14 @@ class MediaVlcPlugin(MediaPlugin): """ Volume down by (default: 10)% """ if not self._player: return None, 'No vlc instance is running' - return self.set_volume(self._player.audio_get_volume()-step) + return self.set_volume(int(max(0, self._player.audio_get_volume()-step))) @action def volup(self, step=10.0): """ Volume up by (default: 10)% """ if not self._player: return None, 'No vlc instance is running' - return self.set_volume(self._player.audio_get_volume()+step) + return self.set_volume(int(min(100, self._player.audio_get_volume()+step))) @action def set_volume(self, volume):