Skip to content

Commit

Permalink
Added extra functions to sonoskeycontroller
Browse files Browse the repository at this point in the history
  • Loading branch information
naxels committed Jan 18, 2021
1 parent c4009de commit 5843994
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sonoskeycontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@ def favourites(speaker):
if action == "play":
speaker.play()
msg = command[0]
elif action == "play_pause":
if speaker.get_current_transport_info()['current_transport_state'] == 'PLAYING':
speaker.pause()
else:
speaker.play()
msg = command[0]
elif action == "track":
msg = 'Track:\n'
t = speaker.get_current_track_info()
for key in t:
msg += f'{key}: {t[key]}\n'
elif action == "volume":
msg = command[0] + ": " + str(speaker.volume)
elif action in ["pause", "stop", "off"]:
speaker.pause()
msg = command[0]
Expand Down

0 comments on commit 5843994

Please sign in to comment.