mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 18:34:25 +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:
parent
201411a65f
commit
e56622128e
@ -374,7 +374,9 @@ def api():
|
|||||||
if response == LogicResponse.Success or \
|
if response == LogicResponse.Success or \
|
||||||
response == LogicResponse.AlreadyLocked or \
|
response == LogicResponse.AlreadyLocked or \
|
||||||
response == LogicResponse.AlreadyOpen:
|
response == LogicResponse.AlreadyOpen:
|
||||||
|
# TBD: Remove 'status'. No more users. Still used in App Version 2.0!
|
||||||
json['status'] = str(logic.state.to_html())
|
json['status'] = str(logic.state.to_html())
|
||||||
|
json['open'] = logic.state == DoorState.Open
|
||||||
return jsonify(json)
|
return jsonify(json)
|
||||||
|
|
||||||
user = request.form.get('user')
|
user = request.form.get('user')
|
||||||
|
Loading…
Reference in New Issue
Block a user