Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions homeassistant/components/media_player/dlna_dmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
import asyncio
from datetime import datetime
from datetime import timedelta
import functools
import logging

Expand All @@ -14,7 +15,7 @@

from homeassistant.components.media_player import (
PLATFORM_SCHEMA, SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PLAY,
SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK, SUPPORT_STOP,
SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK, SUPPORT_SEEK, SUPPORT_STOP,
SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, MediaPlayerDevice)
from homeassistant.const import (
CONF_NAME, CONF_URL, EVENT_HOMEASSISTANT_STOP, STATE_IDLE, STATE_OFF,
Expand All @@ -25,7 +26,7 @@
import homeassistant.helpers.config_validation as cv
from homeassistant.util import get_local_ip

REQUIREMENTS = ['async-upnp-client==0.13.0']
REQUIREMENTS = ['async-upnp-client==0.13.1']

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -233,6 +234,8 @@ def supported_features(self):
supported_features |= SUPPORT_NEXT_TRACK
if self._device.has_play_media:
supported_features |= SUPPORT_PLAY_MEDIA
if self._device.has_seek_rel_time:
supported_features |= SUPPORT_SEEK

return supported_features

Expand Down Expand Up @@ -284,6 +287,16 @@ async def async_media_stop(self):

await self._device.async_stop()

@catch_request_errors()
async def async_media_seek(self, position):
"""Send seek command."""
if not self._device.can_seek_rel_time:
_LOGGER.debug('Cannot do Seek/rel_time')
return

time = timedelta(seconds=position)
await self._device.async_seek_rel_time(time)

@catch_request_errors()
async def async_play_media(self, media_type, media_id, **kwargs):
"""Play a piece of media."""
Expand All @@ -295,7 +308,7 @@ async def async_play_media(self, media_type, media_id, **kwargs):
if self._device.can_stop:
await self.async_media_stop()

# +ueue media
# Queue media
await self._device.async_set_transport_uri(
media_id, title, mime_type, upnp_class)
await self._device.async_wait_for_can_play()
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/upnp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from .device import Device


REQUIREMENTS = ['async-upnp-client==0.13.0']
REQUIREMENTS = ['async-upnp-client==0.13.1']

NOTIFICATION_ID = 'upnp_notification'
NOTIFICATION_TITLE = 'UPnP/IGD Setup'
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ asterisk_mbox==0.5.0

# homeassistant.components.upnp
# homeassistant.components.media_player.dlna_dmr
async-upnp-client==0.13.0
async-upnp-client==0.13.1

# homeassistant.components.axis
axis==16
Expand Down