Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from bottle import route, run, template
- import raumfeld
- @route('/pause')
- def pause():
- devices = raumfeld.discover()
- if len(devices) > 0:
- speaker = devices[0]
- speaker.pause()
- else:
- return 'No devices found.'
- @route('/play')
- def play():
- devices = raumfeld.discover()
- if len(devices) > 0:
- speaker = devices[0]
- speaker.mute = False
- speaker.volume = 60
- speaker.play()
- else:
- return 'No devices found.'
- @route('/player')
- def player():
- return '<html><head><title>rf.player</title><style type="text/css"><!--A{text-decoration:none}--></style></head><h1><a href="/play">▶</a> <a href="/pause">◼</a> <h1>'
- run(host='0.0.0.0', port=8080)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement