Skip to content

Commit

Permalink
Clarify yamaha play_media parameters (home-assistant#10228)
Browse files Browse the repository at this point in the history
The play_media parameters are a little bit black magic for the yamaha
platform, this explains what they are in a code comment instead of
having to go look at the yamaha platform itself.

Fixes Bug home-assistant#10180
  • Loading branch information
sdague authored and fabaff committed Oct 30, 2017
1 parent 5d23afd commit c9c1028
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions homeassistant/components/media_player/yamaha.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,20 @@ def play_media(self, media_type, media_id, **kwargs):
Yamaha to direct play certain kinds of media. media_type is
treated as the input type that we are setting, and media id is
specific to it.
For the NET RADIO mediatype the format for ``media_id`` is a
"path" in your vtuner hierarchy. For instance:
``Bookmarks>Internet>Radio Paradise``. The separators are
``>`` and the parts of this are navigated by name behind the
scenes. There is a looping construct built into the yamaha
library to do this with a fallback timeout if the vtuner
service is unresponsive.
NOTE: this might take a while, because the only API interface
for setting the net radio station emulates button pressing and
navigating through the net radio menu hiearchy. And each sub
menu must be fetched by the receiver from the vtuner service.
"""
if media_type == "NET RADIO":
self._receiver.net_radio(media_id)
Expand Down

0 comments on commit c9c1028

Please sign in to comment.