Developer Interface¶
This part of the documentation covers all the interfaces of Libsoundtouch.
Main Interface¶
Classes¶
Bose Soundtouch Device.
- class libsoundtouch.device.SoundTouchDevice(host, port=8090, ws_port=8080, dlna_port=8091)[source]¶
Bose SoundTouch Device.
- add_zone_slave(slaves)[source]¶
Add slave(s) to and existing zone (multi-room).
Zone must already exist and slaves array can not be empty.
- Parameters:
slaves – List of slaves. Can not be empty
- property config¶
Get config object.
- create_zone(slaves)[source]¶
Create a zone (multi-room) on a master and play on specified slaves.
- Parameters:
slaves – List of slaves. Can not be empty
- property device_info_updated_listeners¶
Return Device Info Updated listeners.
- property dlna_port¶
Return DLNA port.
- property host¶
Host of the device.
- play_media(source, location, source_acc=None, media_type=Type.URI)[source]¶
Start music playback from a chosen source.
- Parameters:
source – Source from which to play. Elements of Source enum.
location – A unique uri or identifier. Represents the requested music from the source.
source_acc – Source account. Imperative for some sources. For Spotify, this can be found by playing Spotify on the connected SoundTouch speaker, and calling: device.status().content_item.source_account
media_type – Type of the requested music. Typical values are: “uri”, “track”, “album”, “playlist”. This can be found in device.status().content_item.type
- play_url(url)[source]¶
Start music playback from an HTTP URL.
Warning: HTTPS is not supported.
- Parameters:
url – HTTP URL to play.
- property port¶
Return API port of the device.
- property presets_updated_listeners¶
Return Presets Updated listeners.
- remove_zone_slave(slaves)[source]¶
Remove slave(s) from and existing zone (multi-room).
Zone must already exist and slaves list can not be empty. Note: If removing last slave, the zone will be deleted and you’ll have to create a new one. You will not be able to add a new slave anymore.
- Parameters:
slaves – List of slaves to remove
- select_content_item(source, source_account=None, location=None, media_type=None)[source]¶
Select specified content.
:param source The source :param source_account The source account :param location The location :param media_type The media type
- status(refresh=True)[source]¶
Get status object.
- Parameters:
refresh – Force refresh, else return old data.
- property status_updated_listeners¶
Return Status Updated listeners.
- volume(refresh=True)[source]¶
Get volume object.
- Parameters:
refresh – Force refresh, else return old data.
- property volume_updated_listeners¶
Return Volume Updated listeners.
- property ws_port¶
Return Web Socket port.
- zone_status(refresh=True)[source]¶
Get Zone Status.
- Parameters:
refresh – Force refresh, else return old data.
- property zone_status_updated_listeners¶
Return Zone Status Updated listeners.
- class libsoundtouch.device.Config(xml_dom)[source]¶
Soundtouch device configuration.
- property account_uuid¶
Account UUID.
- property components¶
Components.
- property country_code¶
Country code.
- property device_id¶
Device ID.
- property device_ip¶
Ip.
- property mac_address¶
Mac address.
- property module_type¶
Return module type.
- property name¶
Device name.
- property networks¶
Network.
- property region_code¶
Region code.
- property type¶
Device type.
- property variant¶
Variant.
- property variant_mode¶
Variant mode.
- class libsoundtouch.device.Network(network_dom)[source]¶
Soundtouch network configuration.
- property ip_address¶
IP Address.
- property mac_address¶
Mac Address.
- property type¶
Type.
- class libsoundtouch.device.Component(component_dom)[source]¶
Soundtouch component.
- property category¶
Category.
- property serial_number¶
Return serial number.
- property software_version¶
Software version.
- class libsoundtouch.device.Status(xml_dom)[source]¶
Soundtouch device status.
- property album¶
Album name.
- property artist¶
Artist.
- property content_item¶
Content item.
- property description¶
Description.
- property duration¶
Duration.
- property image¶
Image URL.
- property play_status¶
Status.
- property position¶
Position.
- property repeat_setting¶
Repeat setting.
- property shuffle_setting¶
Shuffle setting.
- property source¶
Source.
- property station_location¶
Station location.
- property station_name¶
Station name.
- property stream_type¶
Stream type.
- property track¶
Track.
- property track_id¶
Track id.
- class libsoundtouch.device.ContentItem(xml_dom)[source]¶
Content item.
- property is_presetable¶
Return true if presetable.
- property location¶
Location.
- property name¶
Name.
- property source¶
Source.
- property source_account¶
Source account.
- property type¶
Type.
- class libsoundtouch.device.Volume(xml_dom)[source]¶
Volume configuration.
- property actual¶
Actual volume level.
- property muted¶
Return True if volume is muted.
- property target¶
Target volume level.
- class libsoundtouch.device.Preset(preset_dom)[source]¶
Preset.
- property is_presetable¶
Return True if is presetable.
- property location¶
Location.
- property name¶
Name.
- property preset_id¶
Id.
- property source¶
Source.
- property source_account¶
Source account.
- property source_xml¶
XML source.
- property type¶
Type.