1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 02:14:26 +01:00

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

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')