- adding stop to api

This commit is contained in:
jbruce12000 2018-12-22 11:24:12 -05:00
parent 5e5abe5b32
commit 54b65188bd
2 changed files with 7 additions and 0 deletions

2
api.md
View File

@ -7,3 +7,5 @@ curl -d '{"cmd":"run", "profile":"cone-05-lo"}' -H "Content-Type: application/js
curl -d '{"cmd":"run", "profile":"cone-05-lo","startat":60}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api
# stop a schedule
curl -d '{"cmd":"stop"}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api

View File

@ -67,6 +67,11 @@ def handle_api():
profile = Profile(profile_json)
oven.run_profile(profile,startat=startat)
ovenWatcher.record(profile)
if bottle.request.json['cmd'] == 'stop':
log.info("api stop command received")
oven.abort_run()
return { "success" : True }
def find_profile(wanted):