From 5854f568fe5437d4a9ef892bd67061b6b3361ea4 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 23 Jan 2020 12:37:36 +0000 Subject: [PATCH] Fix for 3.x API changes Switches from use of playback controller (deprecated) to mixer volume as mentioned in #1 Uses `get_state()` instead of `state` --- mopidy_raspberry_gpio/frontend.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mopidy_raspberry_gpio/frontend.py b/mopidy_raspberry_gpio/frontend.py index 9e2a3db..1bbdf42 100644 --- a/mopidy_raspberry_gpio/frontend.py +++ b/mopidy_raspberry_gpio/frontend.py @@ -58,7 +58,7 @@ class RaspberryGPIOFrontend(pykka.ThreadingActor, core.CoreListener): ) def handle_play_pause(self): - if self.core.playback.state.get() == core.PlaybackState.PLAYING: + if self.core.playback.get_state().get() == core.PlaybackState.PLAYING: self.core.playback.pause() else: self.core.playback.play() @@ -70,13 +70,13 @@ class RaspberryGPIOFrontend(pykka.ThreadingActor, core.CoreListener): self.core.playback.previous() def handle_volume_up(self): - volume = self.core.playback.volume.get() + volume = self.core.mixer.get_volume().get() volume += 5 volume = min(volume, 100) - self.core.playback.volume = volume + self.core.mixer.set_volume(volume) def handle_volume_down(self): - volume = self.core.playback.volume.get() + volume = self.core.mixer.get_volume().get() volume -= 5 volume = max(volume, 0) - self.core.playback.volume = volume + self.core.mixer.set_volume(volume)