Fix media_pause in vlc_telnet (#46675)

The underlying python-telnet-vlc pause() function toggles play/pause, so
we need to check our state before calling it.
pull/46686/head
David McClosky 2021-02-17 00:39:46 -05:00 committed by GitHub
parent 58499946ed
commit 58f6db0127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -245,7 +245,11 @@ class VlcDevice(MediaPlayerEntity):
def media_pause(self):
"""Send pause command."""
self._vlc.pause()
current_state = self._vlc.status().get("state")
if current_state != "paused":
# Make sure we're not already paused since VLCTelnet.pause() toggles
# pause.
self._vlc.pause()
self._state = STATE_PAUSED
def media_stop(self):