diff --git a/api.md b/api.md index 066b661..b9dea84 100644 --- a/api.md +++ b/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 +# stop a schedule +curl -d '{"cmd":"stop"}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api diff --git a/kiln-controller.py b/kiln-controller.py index 7b38f26..b5a8978 100755 --- a/kiln-controller.py +++ b/kiln-controller.py @@ -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):