production version (with 20s workaround)
This commit is contained in:
+3
-5
@@ -88,17 +88,15 @@ def list_files(dir):
|
|||||||
def btn1_callback(channel):
|
def btn1_callback(channel):
|
||||||
logging.debug("PREV")
|
logging.debug("PREV")
|
||||||
json = call('core.playback.get_time_position').json()
|
json = call('core.playback.get_time_position').json()
|
||||||
position = json['result']
|
if (json['result'] < 4000):
|
||||||
if (position < 4):
|
|
||||||
call('core.playback.previous')
|
call('core.playback.previous')
|
||||||
else:
|
else:
|
||||||
call('core.playback.seek', '{ "time_position": 0 }')
|
call('core.playback.seek', '{ "time_position": 0 }')
|
||||||
|
|
||||||
def btn2_callback(channel):
|
def btn2_callback(channel):
|
||||||
logging.debug("PLAY/PAUSE")
|
logging.debug("PLAY/PAUSE")
|
||||||
json = call('core.playback.get_time_position').json()
|
json = call('core.playback.get_state').json()
|
||||||
state = json['result']
|
if (json['result'] == 'playing'):
|
||||||
if (state == 'playing'):
|
|
||||||
call('core.playback.pause')
|
call('core.playback.pause')
|
||||||
else:
|
else:
|
||||||
call('core.playback.play')
|
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
|
### Spotify URLs
|
||||||
https://open.spotify.com/track/3jQyadhLTxpxadQlkFh2b8
|
https://open.spotify.com/track/3jQyadhLTxpxadQlkFh2b8
|
||||||
https://open.spotify.com/episode/1o8HWRR0mx5TfyxLlnKv8e
|
https://open.spotify.com/episode/1o8HWRR0mx5TfyxLlnKv8e
|
||||||
|
|||||||
Reference in New Issue
Block a user