From 26c3afee68269baeff087ac5f7b35300dc237acf Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 28 Dec 2017 13:13:09 +0100 Subject: [PATCH] Implemented play_or_stop in mpd --- platypush/plugins/music/mpd/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platypush/plugins/music/mpd/__init__.py b/platypush/plugins/music/mpd/__init__.py index 5d5b600d93..f8bede18df 100644 --- a/platypush/plugins/music/mpd/__init__.py +++ b/platypush/plugins/music/mpd/__init__.py @@ -36,6 +36,11 @@ class MusicMpdPlugin(MusicPlugin): def stop(self): return self._exec('stop') + def play_or_stop(self): + status = self.status().output['state'] + if status == 'play': return self._exec('stop') + else: return self._exec('play') + def next(self): return self._exec('next')