SoCo 0.12 release notes¶
SoCo 0.12 is a new version of the SoCo library. This release adds new features and fixes several bugs.
SoCo (Sonos Controller) is a simple Python class that allows you to programmatically control Sonos speakers.
New Features and Improvements¶
New
MusicServiceclass for access to all the music services known to Sonos. Note that some of this code is still unstable, and in particular the data structures returned by methods such asget_metadatamay change in future. (#262, #358)Add information to the docs about how to put SoCo in the Python path, for test execution (#327, #319)
All tests have been moved from the
unittestsdirectory to the tests directory (#336)For developers, more
maketargets, and a better sdist build (#346)Added
discovery.any_soco(), for when you need aSoCoinstance, but you don’t care which. This is slightly better than the traditionaldevice = soco.discover().pop()since it will return an existing instance if one is available, without sending discovery packets (#262)Modified
DidlObject.to_dict()so that any associated resources list will be also returned as a list of dictionaries instead of returning a list ofDidlResourceobjects. (#340, #338)Added a
sonosdumptool indev_tools, which can print out the various UPnP methods which Sonos uses (#344)Added methods for sonos playlist management:
reorder_sonos_playlist,clear_sonos_playlist,move_in_sonos_playlist,remove_from_sonos_playlist,get_sonos_playlist_by_attr(#352, #348, #353) andremove_sonos_playlist(#341, #345)Support playmodes repeat-one (
REPEAT_ONE) and shuffle-repeat-one (SHUFFLE_REPEAT_ONE) introduced by Sonos 6.0 (#387)Better discovery: SoCo tries harder to find devices on the local network, particularly where there are multiple network interfaces. The default discovery timeout is also increased to 5 seconds (#395, #432)
Large work package on the docs, which contains a new front page, more sections, some advanced topics and an example page (#406, #360, #368, #362, #326, #369).
Added optional timeout argument to be passed onto requests when getting speaker info (#302)
Ignore
.#specified subclasses in Didl xml. Several music services seem to use an out-of-spec way to make sub classes in Didl, by specifying the subclass name or function after a #. This caused our implementation of Didl to reject it. This has now been fixed by simple ignoring these un-official subclasses (#425)Added methods to manipulate sonos sleep functionality:
set_sleep_timer,get_sleep_timer(#413)Various cleanups (#351)
Extended
get_speaker_infoto return more information about the Sonos speakers (#335, #320)
Bugfixes¶
Clear zone group cache and reparse zone group information after join and unjoin to prevent giving wrong topology information. (#323, #321)
Fix typo preventing SoCo from parsing the audio metadata object used when a TV is playing. (#331)
Fix bug where SoCo would raise an exception if music services sent metadata with invalid XML characters (#392, #386)
Event lister was (incorrectly) responding to
GETandHEADrequests, which could result in local files being served (#430)Minor fix because ordereddict.values in py3 return ValuesView (#359)
Fixed bugs with parsing events (#276)
Fix in MusicLibrary constructor (#370)
Backwards Compatability¶
Dropped support for Python 3.2 (#324)
Methods relating to the music library (
get_artists,get_album_artists,get_albumsand others) have been moved to themusic_librarymodule. Instead ofdevice.get_album_artists(), please now usedevice.music_library.get_album_artists()etc. Old code will continue to work for the moment, but will raise deprecation warnings (#350)Made a hard deprecation of the Spotify plugin since the API it relied on has been deprecated and it therefore no longer worked (#401, #423)
Dropped pylint checks for Python 2.6 (#363)