New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Nov 7, 2018

Conversation

Projects
None yet
4 participants
@StevenLooman
Contributor

StevenLooman commented Nov 3, 2018

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.

StevenLooman added some commits Nov 3, 2018

@rytilahti

This comment has been minimized.

Contributor

rytilahti commented Nov 5, 2018

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

This comment has been minimized.

Contributor

StevenLooman commented Nov 6, 2018

@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

This comment has been minimized.

Contributor

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 :-))

@dgomes

dgomes approved these changes Nov 7, 2018

@rytilahti rytilahti merged commit d93716b into home-assistant:dev Nov 7, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.065%
Details

@wafflebot wafflebot bot removed the in progress label Nov 7, 2018

@StevenLooman

This comment has been minimized.

Contributor

StevenLooman commented Nov 7, 2018

Fixed in async_upnp_client, to be released later on.

@StevenLooman StevenLooman deleted the StevenLooman:dlna_dmr_seek_mode_media_image branch Nov 7, 2018

@StevenLooman

This comment has been minimized.

Contributor

StevenLooman commented Nov 8, 2018

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

@StevenLooman

This comment has been minimized.

Contributor

StevenLooman commented Nov 11, 2018

Fixes are in #18377.

zxdavb added a commit to zxdavb/home-assistant that referenced this pull request Nov 13, 2018

Add SUPPORT_SEEK for DLNA DMR devices + now (better) providing media_…
…image_url for DLNA DMR devices (home-assistant#18157)

* Upgrade to async_upnp_client==0.13.2, now (better) providing media_image_url for DLNA DMR devices

* Add SUPPORT_SEEK for DLNA DMR devices

@balloob balloob referenced this pull request Nov 29, 2018

Merged

0.83 #18776

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