mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
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
@ -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…
x
Reference in New Issue
Block a user