Provide addition 'open' field in JSON response

Better than parsing german words.

Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
Ralf Ramsauer 2018-08-28 23:16:40 +02:00
parent 201411a65f
commit e56622128e
1 changed files with 2 additions and 0 deletions

View File

@ -374,7 +374,9 @@ def api():
if response == LogicResponse.Success or \
response == LogicResponse.AlreadyLocked or \
response == LogicResponse.AlreadyOpen:
# TBD: Remove 'status'. No more users. Still used in App Version 2.0!
json['status'] = str(logic.state.to_html())
json['open'] = logic.state == DoorState.Open
return jsonify(json)
user = request.form.get('user')