mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
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.
This commit is contained in:
parent
58499946ed
commit
58f6db0127
@ -245,6 +245,10 @@ class VlcDevice(MediaPlayerEntity):
|
||||
|
||||
def media_pause(self):
|
||||
"""Send pause command."""
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user