forked from platypush/platypush
Added MPD play_if_paused and pause_if_playing methods
This commit is contained in:
parent
27b97e584f
commit
96e3acb20f
1 changed files with 10 additions and 0 deletions
|
@ -37,6 +37,16 @@ class MusicMpdPlugin(MusicPlugin):
|
||||||
if status == 'play': return self._exec('pause')
|
if status == 'play': return self._exec('pause')
|
||||||
else: return self._exec('play')
|
else: return self._exec('play')
|
||||||
|
|
||||||
|
def pause_if_playing(self):
|
||||||
|
status = self.status().output['state']
|
||||||
|
if status == 'play': return self._exec('pause')
|
||||||
|
else: return Response(output={})
|
||||||
|
|
||||||
|
def play_if_paused(self):
|
||||||
|
status = self.status().output['state']
|
||||||
|
if status == 'pause': return self._exec('play')
|
||||||
|
else: return Response(output={})
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
return self._exec('stop')
|
return self._exec('stop')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue