From e7c035018d2b41d0d800843416d796f9cf8e5b1f Mon Sep 17 00:00:00 2001 From: jjlawren Date: Wed, 22 Apr 2020 08:31:29 -0500 Subject: [PATCH] Rewrite Plex play_media service descriptions (#13121) --- source/_integrations/plex.markdown | 82 ++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 21 deletions(-) diff --git a/source/_integrations/plex.markdown b/source/_integrations/plex.markdown index 8dfeb8a36bd..26db3d91ae3 100644 --- a/source/_integrations/plex.markdown +++ b/source/_integrations/plex.markdown @@ -110,39 +110,79 @@ By default the Plex integration will create Media Player entities for all local, ### Service `play_media` -Plays a song, playlist, TV episode, or video on a connected client. +Plays a song, album, artist, playlist, TV show/season/episode, movie, or video on a connected client. + +Required fields within the `media_content_id` payloads are marked as such, others are optional. #### Music -| Service data attribute | Optional | Description | Example | -| ---------------------- | -------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `entity_id` | no | `entity_id` of the client | media_player.theater_plex | -| `media_content_id` | no | Quote escaped JSON with `library_name`, `artist_name`, `album_name`, `track_name`, `shuffle` (0 or 1). | { \\"library_name\\" : \\"My Music\\", \\"artist_name\\" : \\"Adele\\", \\"album_name\\" : \\"25\\", \\"track_name\\" : \\"hello\\", \\"shuffle\\": \\"0\\" } | -| `media_content_type` | no | Type of media to play, in this case `MUSIC` | MUSIC | +| Service data attribute | Description | +| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `entity_id` | `entity_id` of the client | +| `media_content_id` | Quoted JSON containing:
| +| `media_content_type` | `MUSIC` | + +##### Examples: +```yaml +entity_id: media_player.plex_player +media_content_type: MUSIC +media_content_id: '{ "library_name": "Music", "artist_name": "Adele", "album_name": "25", "track_name": "Hello" }' +``` +```yaml +entity_id: media_player.plex_player +media_content_type: MUSIC +media_content_id: '{ "library_name": "Music", "artist_name": "Stevie Wonder", "shuffle": "1" }' +``` #### Playlist -| Service data attribute | Optional | Description | Example | -| ---------------------- | -------- | ------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `entity_id` | no | `entity_id` of the client | media_player.theater_plex | -| `media_content_id` | no | Quote escaped JSON with `playlist_name`, `shuffle` (0 or 1). | { \\"playlist_name\\" : \\"The Best of Disco\\" \\"shuffle\\": \\"0\\" } | -| `media_content_type` | no | Type of media to play, in this case `PLAYLIST` | PLAYLIST | +| Service data attribute | Description | +| ---------------------- | --------------------------------------------------------------------------------------------------- | +| `entity_id` | `entity_id` of the client | +| `media_content_id` | Quoted JSON containing:
| +| `media_content_type` | `PLAYLIST` | + +##### Example: +```yaml +entity_id: media_player.plex_player +media_content_type: PLAYLIST +media_content_id: '{ "playlist_name": "The Best of Disco", "shuffle": "1" }' +``` #### TV Episode -| Service data attribute | Optional | Description | Example | -| ---------------------- | -------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `entity_id` | no | `entity_id` of the client | media_player.theater_plex | -| `media_content_id` | no | Quote escaped JSON with `library_name`, `show_name`, `season_number`, `episode_number`, `shuffle` (0 or 1). | { \\"library_name\\" : \\"Adult TV\\", \\"show_name\\" : \\"Rick and Morty\\", \\"season_number\\" : 2, \\"episode_number\\" : 5, \\"shuffle\\": \\"0\\" } | -| `media_content_type` | no | Type of media to play, in this case `EPISODE` | EPISODE | +| Service data attribute | Description | +| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `entity_id` | `entity_id` of the client | +| `media_content_id` | Quoted JSON containing:
| +| `media_content_type` | `EPISODE` | + +##### Examples: +```yaml +entity_id: media_player.plex_player +media_content_type: EPISODE +media_content_id: '{ "library_name": "Adult TV", "show_name": "Rick and Morty", "season_number": 2, "episode_number": 5 }' +``` +```yaml +entity_id: media_player.plex_player +media_content_type: EPISODE +media_content_id: '{ "library_name": "Kid TV", "show_name": "Sesame Street", "shuffle": "1" }' +``` #### Video -| Service data attribute | Optional | Description | Example | -| ---------------------- | -------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `entity_id` | no | `entity_id` of the client | media_player.theater_plex | -| `media_content_id` | no | Quote escaped JSON with `library_name`, `video_name`, `shuffle` (0 or 1). | { \\"library_name\\" : \\"Adult Movies\\", \\"video_name\\" : \\"Blade\\", \\"shuffle\\": \\"0\\" } | -| `media_content_type` | no | Type of media to play, in this case `VIDEO` | VIDEO | +| Service data attribute | Description | +| ---------------------- | ------------------------------------------------------------------------------------------------------- | +| `entity_id` | `entity_id` of the client | +| `media_content_id` | Quoted JSON containing:
| +| `media_content_type` | `VIDEO` | + +##### Example: +```yaml +entity_id: media_player.plex_player +media_content_type: VIDEO +media_content_id: '{ "library_name": "Adult Movies", "video_name": "Blade" }' +``` ### Compatibility