Skip to main content

Some extra useful commands for Sonos systems, based on SoCo.

Project description

Latest PyPI version

Some extra useful commands for Sonos systems, based on SoCo.

Usage

Simple example:

from sonos_extras import SonosExtras
client = SonosExtras("192.168.1.10") # replace with your speaker's IP
client.get_current_track_info()

Methods

stop_after() : stops after the current track is finished

Command Line Interface

Use SonosExtrasCLI as a shell command:

usage: --help [-h] [-i SPEAKER_IP] {version,ver,current,c,play,p,pause,stop,s,playlists,pls,volume,v,line_in,li,stop_after,sa,resume_queue,rq,queue,q} ...

optional arguments:
-h, --help            show this help message and exit
-i SPEAKER_IP, --speaker-ip SPEAKER_IP
                        IP of the speaker to connect to.
                        Also can be set as SONOS_EXTRAS_IP environment variable

sub-commands:
Valid sub-commands. Use -h for each sub-commands to get detailed help.

{version,ver,current,c,play,p,pause,stop,s,playlists,pls,volume,v,line_in,li,stop_after,sa,resume_queue,rq,queue,q}
    version (ver)       Print the current version.
    current (c)         Print the current status, and playback item, if available.
    play (p)            Play.
    pause (p)           Pause.
    stop (s)            Stop.
    playlists (pls)     List sonos playlists.
    volume (v)          Get/set the volume
    line_in (li)        Select LineIn for playback.
    stop_after (sa)     Stop after the current/future track(s).
    resume_queue (rq)   Resume playback from the given index of the current queue.
    queue (q)           Print the current queue.

Installation

pip install sonos-extras

Requirements

python 3.8

Compatibility

Python 3.8

Licence

The MIT License (MIT)

Copyright (c) 2019 MaziarA

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Authors

sonos_extras was written by MaziarA.

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

sonos_extras-0.1.20.tar.gz (9.6 kB view hashes)

Uploaded source

Built Distribution

sonos_extras-0.1.20-py3-none-any.whl (9.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page