- adding stop to api
This commit is contained in:
parent
5e5abe5b32
commit
54b65188bd
2
api.md
2
api.md
@ -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
|
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
|
||||||
|
|||||||
@ -67,6 +67,11 @@ def handle_api():
|
|||||||
profile = Profile(profile_json)
|
profile = Profile(profile_json)
|
||||||
oven.run_profile(profile,startat=startat)
|
oven.run_profile(profile,startat=startat)
|
||||||
ovenWatcher.record(profile)
|
ovenWatcher.record(profile)
|
||||||
|
|
||||||
|
if bottle.request.json['cmd'] == 'stop':
|
||||||
|
log.info("api stop command received")
|
||||||
|
oven.abort_run()
|
||||||
|
|
||||||
return { "success" : True }
|
return { "success" : True }
|
||||||
|
|
||||||
def find_profile(wanted):
|
def find_profile(wanted):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user