Skip to content

Add SUPPORT_SEEK for DLNA DMR devices + now (better) providing media_image_url for DLNA DMR devices#18157

Merged
rytilahti merged 2 commits intohome-assistant:devfrom
StevenLooman:dlna_dmr_seek_mode_media_image
Nov 7, 2018
Merged

Add SUPPORT_SEEK for DLNA DMR devices + now (better) providing media_image_url for DLNA DMR devices#18157
rytilahti merged 2 commits intohome-assistant:devfrom
StevenLooman:dlna_dmr_seek_mode_media_image

Conversation

@StevenLooman
Copy link
Copy Markdown
Contributor

Description:

Add SEEK mode for to DLNA DMR devices and upgrade to async_upnp_client==0.13.2 to better support media_image_url

Related issue (if applicable): fixes #18040

Pull request in home-assistant.io with documentation (if applicable): not applicable

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@rytilahti
Copy link
Copy Markdown
Member

Code-wise this looks pretty straightforward, however, I'm not getting images displayed for my sonoses (works with media_player.sonos though). The entity_picture gets filled, but it returns no image but just ERR_INVALID_RESPONSE.

@StevenLooman
Copy link
Copy Markdown
Contributor Author

@rytilahti To be certain, does the method/property DlnaDmrDevice.media_image_url return ERR_INVALID_RESPONSE? And did it work before?

Can you try, from the environment where you run Home Assistant run this:

$ upnp-client subscribe <url-to-device-description-xml> \*

And start playing media on your Sonos?

This starts listen for UPnP events and shows them. Specifically, I'm looking for some DIDL-Lite/escaped XML.

@rytilahti
Copy link
Copy Markdown
Member

rytilahti commented Nov 6, 2018

I don't think it used to work, but I suppose the property didn't exist earlier (although it's been some time since I had the platform enabled). The error is coming when trying to access the URL in that property manually with the browser. Here's a one-time unescaped value of CurrentTrackMetaData:

'<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:me
tadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="sonos.com-http:*:app
lication/x-mpegURL:*" duration="0:06:26">x-sonosapi-hls-static:catalog%2ftracks%2fB006N9P7BY%2f%3fplaylistAsin%3dB07DW9FC9B%26playlistType%3dprimePlayl
ist?sid=201&amp;flags=0&amp;sn=1</res><r:streamContent></r:streamContent><r:radioShowMd></r:radioShowMd><upnp:albumArtURI>/getaa?s=1&amp;u=x-sonosapi-h
ls-static%3acatalog%252ftracks%252fB006N9P7BY%252f%253fplaylistAsin%253dB07DW9FC9B%2526playlistType%253dprimePlaylist%3fsid%3d201%26flags%3d0%26sn%3d1<
/upnp:albumArtURI><dc:title>Strange</dc:title><upnp:class>object.item.audioItem.musicTrack</upnp:class><dc:creator>Hidden Orchestra</dc:creator><upnp:a
lbum>Chillout-Lounge</upnp:album></item></DIDL-Lite>"/><r:NextTrackURI val="x-sonosapi-hls-static:catalog%2ftracks%2fB0042EUT24%2f%3fplaylistAsin%3dB07
DW9FC9B%26playlistType%3dprimePlaylist?sid=201&flags=0&sn=1'

So it's returning a relative URI for it. Here's what soco does: https://github.com/SoCo/SoCo/blob/master/soco/music_library.py#L59 .

(btw, please document upnp-client --debug-traffic --debug subscribe http://XXX:1400/xml/device_description.xml \* -- that's mightly useful :-))

@rytilahti rytilahti merged commit d93716b into home-assistant:dev Nov 7, 2018
@ghost ghost removed the in progress label Nov 7, 2018
@StevenLooman
Copy link
Copy Markdown
Contributor Author

StevenLooman commented Nov 7, 2018

Fixed in async_upnp_client, to be released later on.

@StevenLooman StevenLooman deleted the dlna_dmr_seek_mode_media_image branch November 7, 2018 20:00
@StevenLooman
Copy link
Copy Markdown
Contributor Author

With additional fix by @rytilahti , to be released later on.

@StevenLooman
Copy link
Copy Markdown
Contributor Author

Fixes are in #18377.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kodi auto detected and manually configured show differently

4 participants