Beginner question about class soco.music_library.MusicLibrary

33 views
Skip to first unread message

BoarGules

unread,
Mar 16, 2020, 10:29:30 AM3/16/20
to SoCo - Sonos Controller

I am doing initial exploration in the SoCo module. Following the tutorial I do


>>> speakers = soco.discover()
>>> speaker = speakers.pop()
>>> speaker.player_name 'Portable'
>>> speaker.ip_address '192.168.0.11'
>>> speaker.get_current_transport_info()['current_transport_state']
'STOPPED'


So far, so good. Now, still following the documentation, I do


>>> speaker.music_library.list_library_shares()
Traceback (most recent call last):
File "<stdin>", line 1, in <module> AttributeError: 'MusicLibrary' object has no attribute 'list_library_shares'


and, sure enough, dir(speaker.music_library) confirms there is no such method. But the documentation for this class says:


Listing and deleting music library shares
Music library shares are the local network drive shares connected to Sonos, which host the audio content in the Sonos Music Library. To list the shares connected to Sonos, use the list_library_shares() method as follows:
››› device.music_library.list_library_shares()
['//share_host_01/music', '//share_host_02/music']
The result is a list of network share locations.

Now either the documentation is badly out of step with the version I just downloaded (0.18.1; it says not), or I need another pair of eyes to point out what I am doing wrong. 

Psychlist

unread,
Mar 16, 2020, 10:49:38 AM3/16/20
to SoCo - Sonos Controller
Hi,

This function is not included in v0.18.1, but will be in the upcoming v0.19 release. It's unintuitive but you need to look at the v0.18.1 documentation at:


... not the 'latest' version of the documentation.

Cheers,
Peter

BoarGules

unread,
Mar 17, 2020, 3:42:29 AM3/17/20
to SoCo - Sonos Controller
Maybe it would be a good idea for the documenters to take a leaf out of the Python book and annotate major changes to the API with new in x.yy or changed in x.yy.
Reply all
Reply to author
Forward
0 new messages