- class plexapi.sonos.PlexSonosClient(account, data)
Class for interacting with a Sonos speaker via the Plex API. This class makes requests to an external Plex API which then forwards the Sonos-specific commands back to your Plex server & Sonos speakers. Use of this feature requires an active Plex Pass subscription and Sonos speakers linked to your Plex account. It also requires remote access to be working properly.
More details on the Sonos integration are available here: https://support.plex.tv/articles/218237558-requirements-for-using-plex-for-sonos/
The Sonos API emulates the Plex player control API closely: https://github.com/plexinc/plex-media-player/wiki/Remote-control-API
PlexAccount) – PlexAccount instance this Sonos speaker is associated with.
data (ElementTree) – Response from Plex Sonos API used to build this client.
deviceClass (str) – “speaker”
lanIP (str) – Local IP address of speaker.
machineIdentifier (str) – Unique ID for this device.
platform (str) – “Sonos”
platformVersion (str) – Build version of Sonos speaker firmware.
product (str) – “Sonos”
protocol (str) – “plex”
protocolCapabilities (list<str>) – List of client capabilities (timeline, playback, playqueues, provider-playback)
PlexServer) – Server this client is connected to.
Session) – Session object used for connection.
title (str) – Name of this Sonos speaker.
token (str) – X-Plex-Token used for authentication
_baseurl (str) – Address of public Plex Sonos API endpoint.
_commandId (int) – Counter for commands sent to Plex API.
_token (str) – Token associated with linked Plex account.
_session (obj) – Requests session object used to access this client.
- playMedia(media, offset=0, **params)
Start playback of the specified media item. See also:
Media) – Media item to be played back (movie, music, photo, playlist, playqueue).
offset (int) – Number of milliseconds at which to start playing with zero representing the beginning (default 0).
**params (dict) – Optional additional parameters to include in the playback request. See also: https://github.com/plexinc/plex-media-player/wiki/Remote-control-API#modified-commands