mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02: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:
@@ -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):
|
||||
|
Reference in New Issue
Block a user