Automatically switch mpd between resume and start playing on media_play (#37854)
* Automatically switch between resume and start playing * Fix Black issue Weirdly when i run it i had an error `1544 files left unchanged, 3313 files failed to reformat.` I didn't watch the commit check output afterward.
This commit is contained in:
parent
3e9f2b8246
commit
353817337e
1 changed files with 4 additions and 1 deletions
|
@ -307,7 +307,10 @@ class MpdDevice(MediaPlayerEntity):
|
||||||
|
|
||||||
def media_play(self):
|
def media_play(self):
|
||||||
"""Service to send the MPD the command for play/pause."""
|
"""Service to send the MPD the command for play/pause."""
|
||||||
self._client.pause(0)
|
if self._status["state"] == "pause":
|
||||||
|
self._client.pause(0)
|
||||||
|
else:
|
||||||
|
self._client.play()
|
||||||
|
|
||||||
def media_pause(self):
|
def media_pause(self):
|
||||||
"""Service to send the MPD the command for play/pause."""
|
"""Service to send the MPD the command for play/pause."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue