Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions examples/commandline/sonoshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from soco import SonosDiscovery

if __name__ == '__main__':
if (len(sys.argv) != 3):
print "Usage: sonoshell.py [speaker's IP|all] [cmd]"
if (len(sys.argv) < 3):
print "Usage: sonoshell.py [speaker's IP|all] [cmd] [option]"
print ""
print "Valid commands (with IP): info, play, pause, stop, next, previous, current, and partymode"
print "Valid commands (with IP): info, play, pause, stop, next, previous, current, volume, and partymode"
print "Valid commands (with 'all'): list_ips"
sys.exit()

Expand Down Expand Up @@ -43,6 +43,11 @@
elif (cmd == 'current'):
track = sonos.get_current_track_info()
print 'Current track: ' + track['artist'] + ' - ' + track['title'] + '. From album ' + track['album'] + '. This is track number ' + track['playlist_position'] + ' in the playlist. It is ' + track['duration'] + ' minutes long.'
elif (cmd == 'volume'):
if (len(sys.argv) > 3):
print sonos.volume(int(sys.argv[3]))
else:
print sonos.volume()
else:
print "Valid commands (with IP): info, play, pause, stop, next, previous, current, and partymode"