mirror of
https://github.com/home-assistant/core.git
synced 2026-09-27 09:58:07 -04:00
Add seek support to plex media players (#43420)
Turns out plexapi lib already supports this, so we just need to pass through the command.
This commit is contained in:
@@ -17,6 +17,7 @@ from homeassistant.components.media_player.const import (
|
||||
SUPPORT_PLAY,
|
||||
SUPPORT_PLAY_MEDIA,
|
||||
SUPPORT_PREVIOUS_TRACK,
|
||||
SUPPORT_SEEK,
|
||||
SUPPORT_STOP,
|
||||
SUPPORT_VOLUME_MUTE,
|
||||
SUPPORT_VOLUME_SET,
|
||||
@@ -494,6 +495,7 @@ class PlexMediaPlayer(MediaPlayerEntity):
|
||||
| SUPPORT_PREVIOUS_TRACK
|
||||
| SUPPORT_NEXT_TRACK
|
||||
| SUPPORT_STOP
|
||||
| SUPPORT_SEEK
|
||||
| SUPPORT_VOLUME_SET
|
||||
| SUPPORT_PLAY
|
||||
| SUPPORT_PLAY_MEDIA
|
||||
@@ -557,6 +559,11 @@ class PlexMediaPlayer(MediaPlayerEntity):
|
||||
if self.device and "playback" in self._device_protocol_capabilities:
|
||||
self.device.stop(self._active_media_plexapi_type)
|
||||
|
||||
def media_seek(self, position):
|
||||
"""Send the seek command."""
|
||||
if self.device and "playback" in self._device_protocol_capabilities:
|
||||
self.device.seekTo(position * 1000, self._active_media_plexapi_type)
|
||||
|
||||
def media_next_track(self):
|
||||
"""Send next track command."""
|
||||
if self.device and "playback" in self._device_protocol_capabilities:
|
||||
|
||||
Reference in New Issue
Block a user