SoCo 0.16 release notes¶
SoCo 0.16 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¶
- Make events server configurable (#602)
- Allow the user a choice in how the event listener is implemented. The default is for the event listener to use the requests library and run in a thread. This update allows the user to run the event listener using the
twisted.internetlibrary, by setting the
config.EVENTS_MODULEmodule to point to the
events_twistedmodule. See the example in
- Stop the event listener when the last active subscription is unsubscribed.
SoCoExceptionon an attempt to subscribe a subscription more than once (use
- Allow an optional
Subscription.unsubscribe(). If set to
False, Exceptions will be logged rather than raised. Default:
- Upon autorenewal, call
strictflag set to
False, so that any Exception is logged, not raised. This is because there is no calling code to catch an Exception.
- Provide for calling code to set
Subscription.auto_renew_failto refer to a callback function. If an Exception occurs upon autorenewal, this callback will be called with the Exception as the sole parameter.
- If an Exception occurs upon
Subscription.renew(), cancel the subscription, unless the Exception was a
Subscription.subscribe(). For example, if an Exception occurs because the network went down, the subscription will be cancelled.
- Use a threading lock with
Subscription.unsubscribe(), because autorenewal occurs from a thread.
- Allow the user to configure the event listener IP address that is sent to the Sonos speakers. The default is to auto detect, but it can now be overridden. This allows for more complex network configurations (e.g. using Docker containers) to be supported. (#604)
play_urimethod now accepts title arguments that need XML escaping. (#605)
- A harmless “Could not handle track info” warning has been removed. (#606)
DIDLMetadataErrors, allowing them to be caught in the event handling code. (#601)
- Added support for