From b2863fd2a389c613541ba10bfc0c7fc17fd868ec Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 10 Oct 2019 16:08:19 +0100 Subject: [PATCH] Fixed volume control limits and steps --- mopidy_raspberry_gpio/frontend.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mopidy_raspberry_gpio/frontend.py b/mopidy_raspberry_gpio/frontend.py index 166f744..829f0b7 100644 --- a/mopidy_raspberry_gpio/frontend.py +++ b/mopidy_raspberry_gpio/frontend.py @@ -76,10 +76,12 @@ class RaspberryGPIOFrontend(pykka.ThreadingActor, core.CoreListener): def handle_volume_up(self): volume = self.core.playback.volume.get() - volume += 10 + volume += 5 + volume = min(volume, 100) self.core.playback.volume = volume def handle_volume_down(self): volume = self.core.playback.volume.get() - volume -= 10 + volume -= 5 + volume = max(volume, 0) self.core.playback.volume = volume