SoCo 0.9 release notes
New Features
Alarm configuration (#171)
>>> from soco.alarms import Alarm, get_alarms >>> # create an alarm with default properties >>> # my_device is the SoCo instance on which the alarm will be played >>> alarm = Alarm(my_device) >>> print alarm.volume 20 >>> print get_alarms() set([]) >>> # save the alarm to the Sonos system >>> alarm.save() >>> print get_alarms() set([<Alarm id:88@15:26:15 at 0x107abb090>]) >>> # update the alarm >>> alarm.recurrence = "ONCE" >>> # Save it again for the change to take effect >>> alarm.save() >>> # Remove it >>> alarm.remove() >>> print get_alarms() set([])
Methods for browsing the Music library (#192, #203, #208)
import soco soc = soco.SoCo('...ipaddress..') some_album = soc.get_albums()['item_list'][0] tracks_in_that_album = soc.browse(some_album)
Support for full Album Art URIs (#207)
Support for music queues (#214)
queue = soco.get_queue() for item in queue: print item.title print queue.number_returned print queue.total_matches print queue.update_id
Support for processing of LastChange events (#194)
Support for write operations on Playlists (#198)
Improvements
Fixes for Python 2.6 support (#175)
Event-subscriptions can be auto-renewed (#179)
The
SoCo
class can replaced by a custom implementation (#180)The cache can be globally disabled (#180)
Music Library data structures are constructed for DIDL XML content (#191).
Added previously removed support for PyPy (#205)
All music library methods (
browse
,get_tracks
etc. #203 andget_queue
#214) now returns container objects instead of dicts or lists. The metadata is now available from these container objects as named attributes, so e.g. on a queue object you can access the size withqueue.total_matches
.
Backwards Compatability
Music library methods return container objects instead of dicts and lists (see above). The old way of accessing that metadata (by dictionary type indexing), has been deprecated and is planned to be removed 3 releases after 0.9.