@app.route('<STR_LIT>', methods=['<STR_LIT:GET>'])<EOL>def get_app_state(device_id, app_id):
if not is_valid_app_id(app_id):<EOL><INDENT>abort(<NUM_LIT>)<EOL><DEDENT>if not is_valid_device_id(device_id):<EOL><INDENT>abort(<NUM_LIT>)<EOL><DEDENT>if device_id not in devices:<EOL><INDENT>abort(<NUM_LIT>)<EOL><DEDENT>app_state = devices[device_id].app_state(app_id)<EOL>return jsonify(state=app_state, status=app_state)<EOL>
Get the state of the requested app