Skip to content

Commit

Permalink
update gstreamer
Browse files Browse the repository at this point in the history
  • Loading branch information
happyleavesaoc committed Apr 8, 2017
1 parent 31da54d commit a738767
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
39 changes: 13 additions & 26 deletions homeassistant/components/media_player/gstreamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import voluptuous as vol

from homeassistant.components.media_player import (
MEDIA_TYPE_MUSIC, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
SUPPORT_PAUSE, SUPPORT_SEEK, SUPPORT_STOP, SUPPORT_PLAY_MEDIA,
SUPPORT_PLAY, SUPPORT_NEXT_TRACK, PLATFORM_SCHEMA, MediaPlayerDevice)
MEDIA_TYPE_MUSIC, SUPPORT_VOLUME_SET, SUPPORT_PAUSE,
SUPPORT_PLAY_MEDIA, SUPPORT_PLAY, SUPPORT_NEXT_TRACK,
PLATFORM_SCHEMA, MediaPlayerDevice)
from homeassistant.const import (
STATE_IDLE, CONF_NAME, EVENT_HOMEASSISTANT_STOP)
import homeassistant.helpers.config_validation as cv
Expand All @@ -20,14 +20,13 @@
_LOGGER = logging.getLogger(__name__)


REQUIREMENTS = ['gstreamer-player==1.0.0']
REQUIREMENTS = ['gstreamer-player==1.1.0']
DOMAIN = 'gstreamer'
CONF_PIPELINE = 'pipeline'


SUPPORT_GSTREAMER = SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \
SUPPORT_PLAY | SUPPORT_PAUSE | SUPPORT_SEEK | SUPPORT_STOP | \
SUPPORT_PLAY_MEDIA | SUPPORT_SEEK | SUPPORT_NEXT_TRACK
SUPPORT_GSTREAMER = SUPPORT_VOLUME_SET | SUPPORT_PLAY | SUPPORT_PAUSE |\
SUPPORT_PLAY_MEDIA | SUPPORT_NEXT_TRACK

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_NAME): cv.string,
Expand Down Expand Up @@ -61,7 +60,6 @@ def __init__(self, player, name):
self._state = STATE_IDLE
self._volume = None
self._duration = None
self._position = None
self._uri = None
self._title = None
self._artist = None
Expand All @@ -72,16 +70,11 @@ def update(self):
self._state = self._player.state
self._volume = self._player.volume
self._duration = self._player.duration
self._position = self._player.position
self._uri = self._player.uri
self._title = self._player.title
self._album = self._player.album
self._artist = self._player.artist

def mute_volume(self, mute):
"""Send the mute command."""
self._player.mute()

def set_volume_level(self, volume):
"""Set the volume level."""
self._player.volume = volume
Expand All @@ -93,9 +86,13 @@ def play_media(self, media_type, media_id, **kwargs):
return
self._player.queue(media_id)

def media_seek(self, position):
"""Seek."""
self._player.position = position
def media_play(self):
"""Play."""
self._player.play()

def media_pause(self):
"""Pause."""
self._player.pause()

def media_next_track(self):
"""Next track."""
Expand All @@ -121,11 +118,6 @@ def volume_level(self):
"""Return the volume level."""
return self._volume

@property
def is_volume_muted(self):
"""Volume muted."""
return self._volume == 0

@property
def supported_features(self):
"""Flag media player features that are supported."""
Expand All @@ -141,11 +133,6 @@ def media_duration(self):
"""Duration of current playing media in seconds."""
return self._duration

@property
def media_position(self):
"""Position of current playing media in seconds."""
return self._position

@property
def media_title(self):
"""Media title."""
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ googlemaps==2.4.6
gps3==0.33.3

# homeassistant.components.media_player.gstreamer
gstreamer-player==1.0.0
gstreamer-player==1.1.0

# homeassistant.components.ffmpeg
ha-ffmpeg==1.5
Expand Down

0 comments on commit a738767

Please sign in to comment.