mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Bump async_upnp_client to 0.16.0 (#48521)
This commit is contained in:
parent
c1ff4197d1
commit
7a6c88feeb
@ -2,6 +2,6 @@
|
|||||||
"domain": "dlna_dmr",
|
"domain": "dlna_dmr",
|
||||||
"name": "DLNA Digital Media Renderer",
|
"name": "DLNA Digital Media Renderer",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/dlna_dmr",
|
"documentation": "https://www.home-assistant.io/integrations/dlna_dmr",
|
||||||
"requirements": ["async-upnp-client==0.14.13"],
|
"requirements": ["async-upnp-client==0.16.0"],
|
||||||
"codeowners": []
|
"codeowners": []
|
||||||
}
|
}
|
||||||
|
@ -14,14 +14,6 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
|
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerEntity
|
||||||
from homeassistant.components.media_player.const import (
|
from homeassistant.components.media_player.const import (
|
||||||
MEDIA_TYPE_CHANNEL,
|
|
||||||
MEDIA_TYPE_EPISODE,
|
|
||||||
MEDIA_TYPE_IMAGE,
|
|
||||||
MEDIA_TYPE_MOVIE,
|
|
||||||
MEDIA_TYPE_MUSIC,
|
|
||||||
MEDIA_TYPE_PLAYLIST,
|
|
||||||
MEDIA_TYPE_TVSHOW,
|
|
||||||
MEDIA_TYPE_VIDEO,
|
|
||||||
SUPPORT_NEXT_TRACK,
|
SUPPORT_NEXT_TRACK,
|
||||||
SUPPORT_PAUSE,
|
SUPPORT_PAUSE,
|
||||||
SUPPORT_PLAY,
|
SUPPORT_PLAY,
|
||||||
@ -70,28 +62,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
HOME_ASSISTANT_UPNP_CLASS_MAPPING = {
|
|
||||||
MEDIA_TYPE_MUSIC: "object.item.audioItem",
|
|
||||||
MEDIA_TYPE_TVSHOW: "object.item.videoItem",
|
|
||||||
MEDIA_TYPE_MOVIE: "object.item.videoItem",
|
|
||||||
MEDIA_TYPE_VIDEO: "object.item.videoItem",
|
|
||||||
MEDIA_TYPE_EPISODE: "object.item.videoItem",
|
|
||||||
MEDIA_TYPE_CHANNEL: "object.item.videoItem",
|
|
||||||
MEDIA_TYPE_IMAGE: "object.item.imageItem",
|
|
||||||
MEDIA_TYPE_PLAYLIST: "object.item.playlistItem",
|
|
||||||
}
|
|
||||||
UPNP_CLASS_DEFAULT = "object.item"
|
|
||||||
HOME_ASSISTANT_UPNP_MIME_TYPE_MAPPING = {
|
|
||||||
MEDIA_TYPE_MUSIC: "audio/*",
|
|
||||||
MEDIA_TYPE_TVSHOW: "video/*",
|
|
||||||
MEDIA_TYPE_MOVIE: "video/*",
|
|
||||||
MEDIA_TYPE_VIDEO: "video/*",
|
|
||||||
MEDIA_TYPE_EPISODE: "video/*",
|
|
||||||
MEDIA_TYPE_CHANNEL: "video/*",
|
|
||||||
MEDIA_TYPE_IMAGE: "image/*",
|
|
||||||
MEDIA_TYPE_PLAYLIST: "playlist/*",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def catch_request_errors():
|
def catch_request_errors():
|
||||||
"""Catch asyncio.TimeoutError, aiohttp.ClientError errors."""
|
"""Catch asyncio.TimeoutError, aiohttp.ClientError errors."""
|
||||||
@ -342,20 +312,15 @@ class DlnaDmrDevice(MediaPlayerEntity):
|
|||||||
@catch_request_errors()
|
@catch_request_errors()
|
||||||
async def async_play_media(self, media_type, media_id, **kwargs):
|
async def async_play_media(self, media_type, media_id, **kwargs):
|
||||||
"""Play a piece of media."""
|
"""Play a piece of media."""
|
||||||
|
_LOGGER.debug("Playing media: %s, %s, %s", media_type, media_id, kwargs)
|
||||||
title = "Home Assistant"
|
title = "Home Assistant"
|
||||||
mime_type = HOME_ASSISTANT_UPNP_MIME_TYPE_MAPPING.get(media_type, media_type)
|
|
||||||
upnp_class = HOME_ASSISTANT_UPNP_CLASS_MAPPING.get(
|
|
||||||
media_type, UPNP_CLASS_DEFAULT
|
|
||||||
)
|
|
||||||
|
|
||||||
# Stop current playing media
|
# Stop current playing media
|
||||||
if self._device.can_stop:
|
if self._device.can_stop:
|
||||||
await self.async_media_stop()
|
await self.async_media_stop()
|
||||||
|
|
||||||
# Queue media
|
# Queue media
|
||||||
await self._device.async_set_transport_uri(
|
await self._device.async_set_transport_uri(media_id, title)
|
||||||
media_id, title, mime_type, upnp_class
|
|
||||||
)
|
|
||||||
await self._device.async_wait_for_can_play()
|
await self._device.async_wait_for_can_play()
|
||||||
|
|
||||||
# If already playing, no need to call Play
|
# If already playing, no need to call Play
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"domain": "ssdp",
|
"domain": "ssdp",
|
||||||
"name": "Simple Service Discovery Protocol (SSDP)",
|
"name": "Simple Service Discovery Protocol (SSDP)",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/ssdp",
|
"documentation": "https://www.home-assistant.io/integrations/ssdp",
|
||||||
"requirements": ["defusedxml==0.6.0", "netdisco==2.8.2", "async-upnp-client==0.14.13"],
|
"requirements": ["defusedxml==0.6.0", "netdisco==2.8.2", "async-upnp-client==0.16.0"],
|
||||||
"after_dependencies": ["zeroconf"],
|
"after_dependencies": ["zeroconf"],
|
||||||
"codeowners": []
|
"codeowners": []
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "UPnP",
|
"name": "UPnP",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/upnp",
|
"documentation": "https://www.home-assistant.io/integrations/upnp",
|
||||||
"requirements": ["async-upnp-client==0.14.13"],
|
"requirements": ["async-upnp-client==0.16.0"],
|
||||||
"codeowners": ["@StevenLooman"],
|
"codeowners": ["@StevenLooman"],
|
||||||
"ssdp": [
|
"ssdp": [
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,7 @@ aiodiscover==1.3.2
|
|||||||
aiohttp==3.7.4.post0
|
aiohttp==3.7.4.post0
|
||||||
aiohttp_cors==0.7.0
|
aiohttp_cors==0.7.0
|
||||||
astral==1.10.1
|
astral==1.10.1
|
||||||
async-upnp-client==0.14.13
|
async-upnp-client==0.16.0
|
||||||
async_timeout==3.0.1
|
async_timeout==3.0.1
|
||||||
attrs==20.3.0
|
attrs==20.3.0
|
||||||
awesomeversion==21.2.3
|
awesomeversion==21.2.3
|
||||||
|
@ -289,7 +289,7 @@ asterisk_mbox==0.5.0
|
|||||||
# homeassistant.components.dlna_dmr
|
# homeassistant.components.dlna_dmr
|
||||||
# homeassistant.components.ssdp
|
# homeassistant.components.ssdp
|
||||||
# homeassistant.components.upnp
|
# homeassistant.components.upnp
|
||||||
async-upnp-client==0.14.13
|
async-upnp-client==0.16.0
|
||||||
|
|
||||||
# homeassistant.components.supla
|
# homeassistant.components.supla
|
||||||
asyncpysupla==0.0.5
|
asyncpysupla==0.0.5
|
||||||
|
@ -178,7 +178,7 @@ arcam-fmj==0.5.3
|
|||||||
# homeassistant.components.dlna_dmr
|
# homeassistant.components.dlna_dmr
|
||||||
# homeassistant.components.ssdp
|
# homeassistant.components.ssdp
|
||||||
# homeassistant.components.upnp
|
# homeassistant.components.upnp
|
||||||
async-upnp-client==0.14.13
|
async-upnp-client==0.16.0
|
||||||
|
|
||||||
# homeassistant.components.aurora
|
# homeassistant.components.aurora
|
||||||
auroranoaa==0.0.2
|
auroranoaa==0.0.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user