diff --git a/platypush/plugins/music/mpd/__init__.py b/platypush/plugins/music/mpd/__init__.py index fb31ab40a2..afa1ecf190 100644 --- a/platypush/plugins/music/mpd/__init__.py +++ b/platypush/plugins/music/mpd/__init__.py @@ -87,6 +87,14 @@ class MusicMpdPlugin(MusicPlugin): if status == 'pause': return self._exec('play') + @action + def play_if_paused_or_stopped(self): + """ Play only if it's paused or stopped """ + + status = self.status().output['state'] + if status == 'pause' or status == 'stop': + return self._exec('play') + @action def stop(self): """ Stop playback """