update gstreamer (#6987)

This commit is contained in:
happyleavesaoc 2017-04-08 17:53:16 -04:00 committed by Paulus Schoutsen
parent c5d89499fa
commit 2277778d8d
2 changed files with 14 additions and 27 deletions

View file

@ -9,9 +9,9 @@ import logging
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
@ -20,14 +20,13 @@ import homeassistant.helpers.config_validation as cv
_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,
@ -61,7 +60,6 @@ class GstreamerDevice(MediaPlayerDevice):
self._state = STATE_IDLE
self._volume = None
self._duration = None
self._position = None
self._uri = None
self._title = None
self._artist = None
@ -72,16 +70,11 @@ class GstreamerDevice(MediaPlayerDevice):
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
@ -93,9 +86,13 @@ class GstreamerDevice(MediaPlayerDevice):
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."""
@ -121,11 +118,6 @@ class GstreamerDevice(MediaPlayerDevice):
"""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."""
@ -141,11 +133,6 @@ class GstreamerDevice(MediaPlayerDevice):
"""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."""

View file

@ -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