production version (with 20s workaround)
This commit is contained in:
+3
-5
@@ -88,17 +88,15 @@ def list_files(dir):
|
||||
def btn1_callback(channel):
|
||||
logging.debug("PREV")
|
||||
json = call('core.playback.get_time_position').json()
|
||||
position = json['result']
|
||||
if (position < 4):
|
||||
if (json['result'] < 4000):
|
||||
call('core.playback.previous')
|
||||
else:
|
||||
call('core.playback.seek', '{ "time_position": 0 }')
|
||||
|
||||
def btn2_callback(channel):
|
||||
logging.debug("PLAY/PAUSE")
|
||||
json = call('core.playback.get_time_position').json()
|
||||
state = json['result']
|
||||
if (state == 'playing'):
|
||||
json = call('core.playback.get_state').json()
|
||||
if (json['result'] == 'playing'):
|
||||
call('core.playback.pause')
|
||||
else:
|
||||
call('core.playback.play')
|
||||
|
||||
@@ -177,6 +177,10 @@ curl -X POST -H Content-Type:application/json -d '{"jsonrpc": "2.0", "id": 1, "m
|
||||
|
||||
|
||||
|
||||
curl -X POST -H Content-Type:application/json -d '{ "method": "core.playback.get_state", "jsonrpc": "2.0", "id": 1 }' http://192.168.1.142:6680/mopidy/rpc
|
||||
|
||||
|
||||
|
||||
### Spotify URLs
|
||||
https://open.spotify.com/track/3jQyadhLTxpxadQlkFh2b8
|
||||
https://open.spotify.com/episode/1o8HWRR0mx5TfyxLlnKv8e
|
||||
|
||||
Reference in New Issue
Block a user