Skip to content
Snippets Groups Projects
Commit 1fb9bd65 authored by CemAdg's avatar CemAdg
Browse files

app.py updated

parent c83be7f5
No related branches found
No related tags found
No related merge requests found
......@@ -37,22 +37,22 @@ def create_app(test_config=None):
"""
@app.route('/lamp/<int:lamp_id>/activate', methods=['GET'])
def activate_lamp(lamp_id):
try:
# activate GPIO pins der Leuchte lamp_id
if lamp_id == 1:
if not lamp_id == 1:
abort(404)
return jsonify({
'lamp_id': lamp_id,
'success': True
})
try:
# activate GPIO pins der Leuchte lamp_id
return jsonify({
'lamp_id': lamp_id,
'success': True
})
except BaseException:
abort(422)
'''
error handlers for aborts
'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment