Defined the two endpoints we need for webapi version 1
Some checks failed
Build RPi Pico firmware image / Build-Firmware (push) Successful in 3m28s
Check code formatting / Check-C-Format (push) Successful in 8s
Check code formatting / Check-Python-Flake8 (push) Failing after 10s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 5s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s
Run pytests / Check-Pytest (push) Successful in 11s
Some checks failed
Build RPi Pico firmware image / Build-Firmware (push) Successful in 3m28s
Check code formatting / Check-C-Format (push) Successful in 8s
Check code formatting / Check-Python-Flake8 (push) Failing after 10s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 5s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s
Run pytests / Check-Pytest (push) Successful in 11s
This commit is contained in:
@@ -25,13 +25,14 @@ async def index(request):
|
|||||||
return "TonberryPico says 'Hello World!'"
|
return "TonberryPico says 'Hello World!'"
|
||||||
|
|
||||||
|
|
||||||
@webapp.route('/v1/api/playback/control', methods=['POST'])
|
@webapp.route('/api/v1/filesystem', methods=['POST'])
|
||||||
async def playback_control(request):
|
async def filesystem_post(request):
|
||||||
if not request.json:
|
# curl -X POST -d "burp" http://192.168.4.1/api/v1/filesystem
|
||||||
return {'success': False}
|
print(request)
|
||||||
|
return {'success': False}
|
||||||
|
|
||||||
# Example:
|
|
||||||
# curl -H "Content-Type: application/json" --data '{"action": "play", "target_type": "audio_file", "target_id": "1234"}' http://192.168.4.1/v1/api/playback/control
|
|
||||||
print(f'Calling {request.json["action"]} on {request.json["target_type"]} with id \
|
|
||||||
{request.json["target_id"]}')
|
|
||||||
|
|
||||||
|
@webapp.route('/api/v1/playlist', methods=['POST'])
|
||||||
|
async def playlist_post(request):
|
||||||
|
print(request)
|
||||||
|
return {'success': False}
|
||||||
|
|||||||
Reference in New Issue
Block a user