Beispiel #1
0
def unlock_fingerprint():
    # lock using nfc id
    logic_resp = ViewRestLogic.unlock_findlock_fingerprint(request.form)

    if not logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return ApiReturn.f_success(logic_resp.content).toFlask()
Beispiel #2
0
def change_state_front(device_uuid, state):
    #state: lock or unlock
    logic_resp = ViewRestLogic.change_findlock_state_frontend(
        device_uuid, state)
    if not logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return ApiReturn.f_success(logic_resp.success).toFlask()
Beispiel #3
0
def get_state_front(device_uuid):
    logic_resp = ViewRestLogic.get_findlock_state_frontend(device_uuid)
    if not logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return ApiReturn.f_success(logic_resp.addon_data).toFlask()
Beispiel #4
0
def light_front(device_uuid):
    logic_resp = ViewRestLogic.light_findlock_frontend(device_uuid)
    if not logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return ApiReturn.f_success(logic_resp.content).toFlask()
Beispiel #5
0
def light():
    debug.print_v(f"on light()")
    logic_resp = ViewRestLogic.light_findlock(request.form)
    if logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return ApiReturn.f_success(logic_resp.content).toFlask()
Beispiel #6
0
def get_name_by_uuid(i_uuid):
    logic_resp = ViewRestLogic.get_name_by_uuid(i_uuid)
    if not logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return ApiReturn.f_success(logic_resp.content).toFlask()
Beispiel #7
0
def get_last_location(device_uuid):
    logic_resp = ViewRestLogic.get_findlock_location(device_uuid)
    if not logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return jsonify(logic_resp.addon_data)
Beispiel #8
0
def update_findlock():
    logic_resp = ViewRestLogic.update_findlock(request.form)
    if not logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return ApiReturn.f_success(logic_resp.success).toFlask()
Beispiel #9
0
def get_findlock():
    logic_resp = ViewRestLogic.get_findlock(request.form)
    if not logic_resp.success:
        return ApiReturn.f_error(logic_resp.content).toFlask()
    return ApiReturn.f_success(logic_resp.addon_data).toFlask()
Beispiel #10
0
def index():
    return ApiReturn.f_success("Hello, World!").toFlask()