@app.route('<STR_LIT>', methods=['<STR_LIT:GET>'])<EOL>def device_action(device_id, action_id):
success = False<EOL>if device_id in devices:<EOL><INDENT>input_cmd = getattr(devices[device_id], action_id, None)<EOL>if callable(input_cmd):<EOL><INDENT>input_cmd()<EOL>success = True<EOL><DEDENT><DEDENT>return jsonify(success=success)<EOL>
Initiate device action via HTTP GET.