Skip to main content

A library and cli to communicate with Bose Soundtouch devices

Project description

A python library and cli for the Bose SoundTouch (R) API.

To be able to use my Bose Soundtouch 10 from the command line.

And to be able to use it as library for Home-Assistant https://home-assistant.io/

And to be ‘my first pip’ package :-)

Installation

To install boos python library, simply:

pip install boos

boos requires Python >= 3.4.

Quick Start

Connect to your Bose SoundTouch (R) device and activate preset 3

To work in python:

from boos import Boos

booz = Boos("http://boos.fritz.box:8090")
booz.preset(3)
booz.vol()
booz.vol(30)

Or if you can run python 3 code for example on Linux:

# create a symbolic link to the cli.py
# and (for now) be sure in cli.py you have the right url defined
sudo ln -s ./boos/cli.py /usr/local/bin/boos
# run
boos
boos set 3
boos vol
boos vol 30

Packaging

All from https://python-packaging-user-guide.readthedocs.org/en/latest/distributing/#source-distributions

# source dist
python3 setup.py sdist
# creating a universal wheel?
python3 setup.py bdist_wheel

# now setup a local webserver to test
cd dist
python -m SimpleHTTPServer 9000

# and in another terminal
# create a python 3 virtual environment venv (all as usual)
virtualenv -p python3 venv
cd venv
source bin/activate
# now in python
python 3
>>> from boos import Boos
>>> booz = Boos("http://boos.fritz.box:8090")
>>> booz.preset(3)

# https://packaging.python.org/en/latest/distributing/#uploading-your-project-to-pypi
#
# to upload it to testpypi (https://wiki.python.org/moin/TestPyPI)
# first register the project
python setup.py register -r https://testpypi.python.org/pypi
# preferred (but not working with me):
twine upload -r https://testpypi.python.org/pypi -u rduivenvoorde -p <PASSWORD> dist/*
# or
python setup.py sdist upload -r https://testpypi.python.org/pypi
# after upload install via
# search
pip search --index https://testpypi.python.org/pypi boos
# install
pip install -i https://testpypi.python.org/pypi boos

# or to pypi
# preferred:
# first register project
python setup.py register
# then preferred
twine upload dist/*
# or
python setup.py sdist upload -r https://pypi.python.org/pypi
# and install
pip install boos

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boos-0.5.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page