bosesoundtouchapi


Namebosesoundtouchapi JSON
Version 1.0.68 PyPI version JSON
download
home_pageNone
SummaryBOSE SoundTouch API Python3 Library
upload_time2024-10-05 00:39:44
maintainerNone
docs_urlNone
authorTodd Lucas
requires_python>3.4.1
licenseNone
keywords bose soundtouch api audio speaker
VCS
bugtrack_url
requirements platformdirs smartinspectPython tinytag urllib3 websocket-client zeroconf twine wheel pdoc
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 class="modulename">
Bose SoundTouch API Python3 Library
</h1>

## Overview
This API provides Python programmers the ability to control Bose SoundTouch speakers from any program written in Python 3.

It utilizes the Bose SoundTouch Webservices API, which is hosted on each SoundTouch device.

More information about Bose SoundTouch speakers can be found on the <a href="https://www.boselatam.com/en_ar/products/speakers/smart_home/soundtouch_family.html" target="_blank">Bose SoundTouch Family page</a>.

## Features

The following features are supported by this API.
- Media Player controls (play pause, resume, next track, prev track, repeat, shuffle, etc)
- Media Content (streaming radio, play http or https url, Google TTS)
- Media Volume control (set / retrieve, tick up / down, mute, smart mute)
- Select Sources (Aux, Bluetooth, Airplay, Deezer, Spotify, iHeart, SiriusXm, etc)
- Multi-room Zone functions (create zone, add / remove zone members, syncronized play)
- Power functions (smart power on / off, power toggle, power to standby)
- Audio mode switching (Normal, Dialog, etc)
- Audio Tone Controls for Bass and Treble Levels (set, retrieve, supported min / max values)
- Audio Product CEC HDMI Control support (set, retrieve, supported values)
- Presets (store, remove, remove all, select)
- Recent Media History (list recent content that was played, select recent item for play)
- Pandora Music Service Support (add / remove stations, get saved stations, search for stations)
- Favorites and Ratings (add, remove, thumbs up, thumbs down)
- Snapshot device settings (store, restore)
- Change Device Name
- Configuration data (clock time, clock, timezone, capabilities, bass capabilities)
- Notifications (receive real-time status updates from the device)
- Wireless configuration options (available networks in range, set last wifi source)
- Firmware update configuration (query software update status, check configuration)
- Zeroconf (aka MDNS) discovery of SoundTouch devices on the network
- ID3 tag support for media content played from a url
- ... and more

## Requirements and Dependencies
The following requirements must be met in order to utilize this API:

* Bose SoundTouch Speaker(s) that support the SoundTouch Webservices API.
    - SoundTouch 10
    - SoundTouch 300
    - I have only tested with the above (what can I say; Bose products are expensive, and I can only afford the two! :D )
    - Other SoundTouch devices should be compatible.
    - Note that the newer line of Bose Speakers (Home Speaker 500, 700, etc) are NOT supported as they do not utilize the Bose WebServices API.

The following Python-related requirements must be met in order to utilize this API:

* Python 3.4 or greater (Python 2 not supported).
* smartinspectPython package (>= 3.0.21) - for diagnostics and logging support.
* websocket-client package (>= 2.0).
* urllib3 package (>= 1.2.0).

## Documentation
Documentation is located in the package library under the 'docs' folder; use the index.html as your starting point. 
You can also view the latest docs on the <a href="https://bosesoundtouchapi.readthedocs.io/en/latest/__init__.html" target="_blank">readthedocs web-site</a>.

## Installation

This module can be easily installed via pip:
``` bash
$ python3 -m pip install bosesoundtouchapi
```

## Quick-Start Sample Code

Almost every method is documented with sample code; just click on the "Sample Code" links under the method, and use the "Copy to Clipboard" functionality to copy / paste.

Check out the following classes to get you started:
- `bosesoundtouchapi.soundtouchclient.SoundTouchClient` - device controls and data gathering.  
- `bosesoundtouchapi.soundtouchdiscovery.SoundTouchDiscovery` - device discovery via Zeroconf.  
- `bosesoundtouchapi.ws.soundtouchwebsocket.SoundTouchWebSocket` - web-socket notification support.  

## Licensing
This project is licensed and distributed under the terms of the MIT End-User License Agreement (EULA) license.

Portions of this code and the overall "flow" were taken from contributions made by <a href="https://github.com/MatrixEditor" target="_blank">MatrixEditor</a>.  My original intent was to fork his repository and add some changes, but there were just too many and I wanted to change some things that would have broken backward compatibility so I continued with my own repository.  

## Logging / Tracing Support

The SmartInspectPython package (installed with this package) can be used to easily debug your applications that utilize this API.

The following topics and code samples will get you started on how to enable logging support.  
Note that logging support can be turned on and off without changing code or restarting the application.  
Click on the topics below to expand the section and reveal more information.  

<details>
  <summary>Configure Logging Support Settings File</summary>
  <br/>
  Add the following lines to a new file (e.g. "smartinspect.cfg") in your application startup / test directory.  
  Note the file name can be whatever you like, just specify it on the call to `SiAuto.Si.LoadConfiguration()` when initializing the logger.

``` ini
; smartinspect.cfg

; SmartInspect Logging Configuration General settings.
; - "Enabled" parameter to turn logging on (True) or off (False).
; - "Level" parameter to control the logging level (Debug|Verbose|Message|Warning|Error).
; - "AppName" parameter to control the application name.
Enabled = False 
Level = Verbose
DefaultLevel = Debug
AppName = My Application Name

; SmartInspect Logging Configuration Output settings.
; - Log to SmartInspect Console Viewer running on the specified network address.
Connections = tcp(host=192.168.1.1,port=4228,timeout=5000,reconnect=true,reconnect.interval=10s,async.enabled=true)
; - Log to a file, keeping 14 days worth of logs.
;Connections = "file(filename=\"./tests/logfiles/logfile.log\", rotate=daily, maxparts=14, append=true)"
; - Log to an encrypted file, keeping 14 days worth of logs.
;Connections = "file(filename=\"./tests/logfiles/logfileEncrypted.sil\", encrypt=true, key=""1234567890123456"", rotate=daily, maxparts=14, append=true)"
        
; set defaults for new sessions
; note that session defaults do not apply to the SiAuto.Main session, since
; this session was already added before a configuration file can be loaded. 
; session defaults only apply to newly added sessions and do not affect existing sessions.
SessionDefaults.Active = True
SessionDefaults.Level = Message
SessionDefaults.ColorBG = 0xFFFFFF

; configure some individual session properties.
; note that this does not add the session to the sessionmanager; it simply
; sets the property values IF the session name already exists.
Session.Main.Active = True
Session.Main.ColorBG = 0xFFFFFF
```

</details>

<details>
  <summary>Initialize Logging Support, MAIN module</summary>
  <br/>
  Add the following lines to your program startup module.  
  This will import the necessary package modules, and initialize logging support.  
  NOTE - This code should only be executed one time!  

``` python
# load SmartInspect settings from a configuration settings file.
from smartinspectpython.siauto import *
siConfigPath:str = "./tests/smartinspect.cfg"
SIAuto.Si.LoadConfiguration(siConfigPath)

# start monitoring the configuration file for changes, and reload it when it changes.
# this will check the file for changes every 60 seconds.
siConfig:SIConfigurationTimer = SIConfigurationTimer(SIAuto.Si, siConfigPath)

# get smartinspect logger reference.
_logsi:SISession = SIAuto.Main

# log system environment and application startup parameters.
_logsi.LogSeparator(SILevel.Fatal)
_logsi.LogAppDomain(SILevel.Verbose)
_logsi.LogSystem(SILevel.Verbose)
```

</details>

<details>
  <summary>Initialize Logging Support, CLASS or sub-modules</summary>
  <br/>
  Add the following lines to your program supporting modules.  
  This will import the necessary package modules, and initialize the shared logging session.  

``` python
# get smartinspect logger reference.
from smartinspectpython.siauto import *
_logsi:SISession = SIAuto.Main
```

</details>

<details>
  <summary>More Information on SmartInspect</summary>
  <br/>
  You can use SmartInspectPython by itself to create log files for your own applications.  
  Use the following PIP command to install the SmartInspectPython package from PyPi.org:  

  ``` bash
  $ python3 -m pip install smartinspectpython
  ```

  The SmarrtInspect Redistributable Console Viewer (free) is required to view SmartInspect Log (.sil) formatted log files, as well capture packets via the TcpProtocol or PipeProtocol connections.  The Redistributable Console Viewer can be downloaded from the <a href="https://code-partners.com/offerings/smartinspect/releases/" target="_blank">Code-Partners Software Downloads Page</a>. Note that the "Redistributable Console Viewer" is a free product, while the "SmartInspect Full Setup" is the Professional level viewer that adds a few more bells and whistles for a fee.  Also note that a Console Viewer is NOT required to view plain text (non .sil) formatted log files.
</details>

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

1. Fork the Project
2. Create your Feature Branch  `git checkout -b feature/AmazingFeature`
3. Commit your Changes  `git commit -m 'Add some AmazingFeature'`
4. Push to the Branch  `git push origin feature/AmazingFeature`
5. Open a Pull Request



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bosesoundtouchapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">3.4.1",
    "maintainer_email": null,
    "keywords": "bose, soundtouch, api, audio, speaker",
    "author": "Todd Lucas",
    "author_email": "<thlucas@yahoo.com>",
    "download_url": null,
    "platform": null,
    "description": "<h1 class=\"modulename\">\r\nBose SoundTouch API Python3 Library\r\n</h1>\r\n\r\n## Overview\r\nThis API provides Python programmers the ability to control Bose SoundTouch speakers from any program written in Python 3.\r\n\r\nIt utilizes the Bose SoundTouch Webservices API, which is hosted on each SoundTouch device.\r\n\r\nMore information about Bose SoundTouch speakers can be found on the <a href=\"https://www.boselatam.com/en_ar/products/speakers/smart_home/soundtouch_family.html\" target=\"_blank\">Bose SoundTouch Family page</a>.\r\n\r\n## Features\r\n\r\nThe following features are supported by this API.\r\n- Media Player controls (play pause, resume, next track, prev track, repeat, shuffle, etc)\r\n- Media Content (streaming radio, play http or https url, Google TTS)\r\n- Media Volume control (set / retrieve, tick up / down, mute, smart mute)\r\n- Select Sources (Aux, Bluetooth, Airplay, Deezer, Spotify, iHeart, SiriusXm, etc)\r\n- Multi-room Zone functions (create zone, add / remove zone members, syncronized play)\r\n- Power functions (smart power on / off, power toggle, power to standby)\r\n- Audio mode switching (Normal, Dialog, etc)\r\n- Audio Tone Controls for Bass and Treble Levels (set, retrieve, supported min / max values)\r\n- Audio Product CEC HDMI Control support (set, retrieve, supported values)\r\n- Presets (store, remove, remove all, select)\r\n- Recent Media History (list recent content that was played, select recent item for play)\r\n- Pandora Music Service Support (add / remove stations, get saved stations, search for stations)\r\n- Favorites and Ratings (add, remove, thumbs up, thumbs down)\r\n- Snapshot device settings (store, restore)\r\n- Change Device Name\r\n- Configuration data (clock time, clock, timezone, capabilities, bass capabilities)\r\n- Notifications (receive real-time status updates from the device)\r\n- Wireless configuration options (available networks in range, set last wifi source)\r\n- Firmware update configuration (query software update status, check configuration)\r\n- Zeroconf (aka MDNS) discovery of SoundTouch devices on the network\r\n- ID3 tag support for media content played from a url\r\n- ... and more\r\n\r\n## Requirements and Dependencies\r\nThe following requirements must be met in order to utilize this API:\r\n\r\n* Bose SoundTouch Speaker(s) that support the SoundTouch Webservices API.\r\n    - SoundTouch 10\r\n    - SoundTouch 300\r\n    - I have only tested with the above (what can I say; Bose products are expensive, and I can only afford the two! :D )\r\n    - Other SoundTouch devices should be compatible.\r\n    - Note that the newer line of Bose Speakers (Home Speaker 500, 700, etc) are NOT supported as they do not utilize the Bose WebServices API.\r\n\r\nThe following Python-related requirements must be met in order to utilize this API:\r\n\r\n* Python 3.4 or greater (Python 2 not supported).\r\n* smartinspectPython package (>= 3.0.21) - for diagnostics and logging support.\r\n* websocket-client package (>= 2.0).\r\n* urllib3 package (>= 1.2.0).\r\n\r\n## Documentation\r\nDocumentation is located in the package library under the 'docs' folder; use the index.html as your starting point. \r\nYou can also view the latest docs on the <a href=\"https://bosesoundtouchapi.readthedocs.io/en/latest/__init__.html\" target=\"_blank\">readthedocs web-site</a>.\r\n\r\n## Installation\r\n\r\nThis module can be easily installed via pip:\r\n``` bash\r\n$ python3 -m pip install bosesoundtouchapi\r\n```\r\n\r\n## Quick-Start Sample Code\r\n\r\nAlmost every method is documented with sample code; just click on the \"Sample Code\" links under the method, and use the \"Copy to Clipboard\" functionality to copy / paste.\r\n\r\nCheck out the following classes to get you started:\r\n- `bosesoundtouchapi.soundtouchclient.SoundTouchClient` - device controls and data gathering.  \r\n- `bosesoundtouchapi.soundtouchdiscovery.SoundTouchDiscovery` - device discovery via Zeroconf.  \r\n- `bosesoundtouchapi.ws.soundtouchwebsocket.SoundTouchWebSocket` - web-socket notification support.  \r\n\r\n## Licensing\r\nThis project is licensed and distributed under the terms of the MIT End-User License Agreement (EULA) license.\r\n\r\nPortions of this code and the overall \"flow\" were taken from contributions made by <a href=\"https://github.com/MatrixEditor\" target=\"_blank\">MatrixEditor</a>.  My original intent was to fork his repository and add some changes, but there were just too many and I wanted to change some things that would have broken backward compatibility so I continued with my own repository.  \r\n\r\n## Logging / Tracing Support\r\n\r\nThe SmartInspectPython package (installed with this package) can be used to easily debug your applications that utilize this API.\r\n\r\nThe following topics and code samples will get you started on how to enable logging support.  \r\nNote that logging support can be turned on and off without changing code or restarting the application.  \r\nClick on the topics below to expand the section and reveal more information.  \r\n\r\n<details>\r\n  <summary>Configure Logging Support Settings File</summary>\r\n  <br/>\r\n  Add the following lines to a new file (e.g. \"smartinspect.cfg\") in your application startup / test directory.  \r\n  Note the file name can be whatever you like, just specify it on the call to `SiAuto.Si.LoadConfiguration()` when initializing the logger.\r\n\r\n``` ini\r\n; smartinspect.cfg\r\n\r\n; SmartInspect Logging Configuration General settings.\r\n; - \"Enabled\" parameter to turn logging on (True) or off (False).\r\n; - \"Level\" parameter to control the logging level (Debug|Verbose|Message|Warning|Error).\r\n; - \"AppName\" parameter to control the application name.\r\nEnabled = False \r\nLevel = Verbose\r\nDefaultLevel = Debug\r\nAppName = My Application Name\r\n\r\n; SmartInspect Logging Configuration Output settings.\r\n; - Log to SmartInspect Console Viewer running on the specified network address.\r\nConnections = tcp(host=192.168.1.1,port=4228,timeout=5000,reconnect=true,reconnect.interval=10s,async.enabled=true)\r\n; - Log to a file, keeping 14 days worth of logs.\r\n;Connections = \"file(filename=\\\"./tests/logfiles/logfile.log\\\", rotate=daily, maxparts=14, append=true)\"\r\n; - Log to an encrypted file, keeping 14 days worth of logs.\r\n;Connections = \"file(filename=\\\"./tests/logfiles/logfileEncrypted.sil\\\", encrypt=true, key=\"\"1234567890123456\"\", rotate=daily, maxparts=14, append=true)\"\r\n        \r\n; set defaults for new sessions\r\n; note that session defaults do not apply to the SiAuto.Main session, since\r\n; this session was already added before a configuration file can be loaded. \r\n; session defaults only apply to newly added sessions and do not affect existing sessions.\r\nSessionDefaults.Active = True\r\nSessionDefaults.Level = Message\r\nSessionDefaults.ColorBG = 0xFFFFFF\r\n\r\n; configure some individual session properties.\r\n; note that this does not add the session to the sessionmanager; it simply\r\n; sets the property values IF the session name already exists.\r\nSession.Main.Active = True\r\nSession.Main.ColorBG = 0xFFFFFF\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n  <summary>Initialize Logging Support, MAIN module</summary>\r\n  <br/>\r\n  Add the following lines to your program startup module.  \r\n  This will import the necessary package modules, and initialize logging support.  \r\n  NOTE - This code should only be executed one time!  \r\n\r\n``` python\r\n# load SmartInspect settings from a configuration settings file.\r\nfrom smartinspectpython.siauto import *\r\nsiConfigPath:str = \"./tests/smartinspect.cfg\"\r\nSIAuto.Si.LoadConfiguration(siConfigPath)\r\n\r\n# start monitoring the configuration file for changes, and reload it when it changes.\r\n# this will check the file for changes every 60 seconds.\r\nsiConfig:SIConfigurationTimer = SIConfigurationTimer(SIAuto.Si, siConfigPath)\r\n\r\n# get smartinspect logger reference.\r\n_logsi:SISession = SIAuto.Main\r\n\r\n# log system environment and application startup parameters.\r\n_logsi.LogSeparator(SILevel.Fatal)\r\n_logsi.LogAppDomain(SILevel.Verbose)\r\n_logsi.LogSystem(SILevel.Verbose)\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n  <summary>Initialize Logging Support, CLASS or sub-modules</summary>\r\n  <br/>\r\n  Add the following lines to your program supporting modules.  \r\n  This will import the necessary package modules, and initialize the shared logging session.  \r\n\r\n``` python\r\n# get smartinspect logger reference.\r\nfrom smartinspectpython.siauto import *\r\n_logsi:SISession = SIAuto.Main\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n  <summary>More Information on SmartInspect</summary>\r\n  <br/>\r\n  You can use SmartInspectPython by itself to create log files for your own applications.  \r\n  Use the following PIP command to install the SmartInspectPython package from PyPi.org:  \r\n\r\n  ``` bash\r\n  $ python3 -m pip install smartinspectpython\r\n  ```\r\n\r\n  The SmarrtInspect Redistributable Console Viewer (free) is required to view SmartInspect Log (.sil) formatted log files, as well capture packets via the TcpProtocol or PipeProtocol connections.  The Redistributable Console Viewer can be downloaded from the <a href=\"https://code-partners.com/offerings/smartinspect/releases/\" target=\"_blank\">Code-Partners Software Downloads Page</a>. Note that the \"Redistributable Console Viewer\" is a free product, while the \"SmartInspect Full Setup\" is the Professional level viewer that adds a few more bells and whistles for a fee.  Also note that a Console Viewer is NOT required to view plain text (non .sil) formatted log files.\r\n</details>\r\n\r\n## Contributing\r\n\r\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\r\n\r\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\r\n\r\n1. Fork the Project\r\n2. Create your Feature Branch  `git checkout -b feature/AmazingFeature`\r\n3. Commit your Changes  `git commit -m 'Add some AmazingFeature'`\r\n4. Push to the Branch  `git push origin feature/AmazingFeature`\r\n5. Open a Pull Request\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "BOSE SoundTouch API Python3 Library",
    "version": "1.0.68",
    "project_urls": {
        "Changelog": "https://github.com/thlucas1/bosesoundtouchapi/blob/master/CHANGELOG.md",
        "Documentation": "https://bosesoundtouchapi.readthedocs.io/en/latest/__init__.html",
        "GitHub": "https://github.com/thlucas1/bosesoundtouchapi"
    },
    "split_keywords": [
        "bose",
        " soundtouch",
        " api",
        " audio",
        " speaker"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b3496f62d850bfdbdd43b12c3c4b511d40a5ab74de60247a26c2d0c5b1fa893",
                "md5": "44d92ff8d064b5f13216e4e96f0e047a",
                "sha256": "cbefca06a1547e166ad25f2818789cfb9babe344e0f00592c6fd8b7918e38b83"
            },
            "downloads": -1,
            "filename": "bosesoundtouchapi-1.0.68-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "44d92ff8d064b5f13216e4e96f0e047a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">3.4.1",
            "size": 985188,
            "upload_time": "2024-10-05T00:39:44",
            "upload_time_iso_8601": "2024-10-05T00:39:44.184743Z",
            "url": "https://files.pythonhosted.org/packages/8b/34/96f62d850bfdbdd43b12c3c4b511d40a5ab74de60247a26c2d0c5b1fa893/bosesoundtouchapi-1.0.68-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-05 00:39:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thlucas1",
    "github_project": "bosesoundtouchapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "platformdirs",
            "specs": [
                [
                    "==",
                    "4.1.0"
                ]
            ]
        },
        {
            "name": "smartinspectPython",
            "specs": [
                [
                    "==",
                    "3.0.33"
                ]
            ]
        },
        {
            "name": "tinytag",
            "specs": [
                [
                    "==",
                    "1.10.0"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    ">=",
                    "1.21.1"
                ],
                [
                    "<",
                    "1.27"
                ]
            ]
        },
        {
            "name": "websocket-client",
            "specs": [
                [
                    "==",
                    "1.6.4"
                ]
            ]
        },
        {
            "name": "zeroconf",
            "specs": []
        },
        {
            "name": "twine",
            "specs": [
                [
                    "==",
                    "5.1.1"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": [
                [
                    "==",
                    "0.41.2"
                ]
            ]
        },
        {
            "name": "pdoc",
            "specs": [
                [
                    "==",
                    "14.3.0"
                ]
            ]
        }
    ],
    "lcname": "bosesoundtouchapi"
}
        
Elapsed time: 0.31384s