Ejemplo n.º 1
0
def get_report():
    receiver = request.args.get('receiver')
    start_time = request.args.get('start')
    end_time = request.args.get('end')
    #################################################################
    report = raw_data.load_data('data/report.json')
    #################################################################
    return jsonify(report)
Ejemplo n.º 2
0
def get_real_time_data():
    receiver = request.args.get('receiver')
    #################################################################
    receivers = raw_data.load_data('data/real_time.json')
    data = [i for i in receivers['data'] if i['receiver'] == receiver]
    receivers['data'] = data
    #################################################################
    return jsonify(receivers)
Ejemplo n.º 3
0
def save_battery_setting():
    receiver = request.args.get('receiver')
    receiver_sn = request.args.get('receiver_sn')
    temp_lower = request.args.get('tempLower')
    temp_upper = request.args.get('tempUpper')
    voltage_lower = request.args.get('voltageLower')
    voltage_upper = request.args.get('voltageUpper')
    battery_setting_data = raw_data.load_data('data/battery_setting.json')
    return jsonify(battery_setting_data)
Ejemplo n.º 4
0
def get_battery_details():
    battery = request.args.get('battery')
    start_time = request.args.get('start')
    end_time = request.args.get('end')
    """
    如果未收到start_time和end_time,可自定义搜索时间
    """
    #################################################################
    battery_details = raw_data.load_data('data/battery_detail.json')
    #################################################################
    return jsonify(battery_details)
Ejemplo n.º 5
0
def get_alarm_data():
    receiver = request.args.get('receiver')
    #################################################################
    receivers = raw_data.load_data('data/alarm.json')
    if receiver == "all":
        return jsonify(receivers)
    else:
        data = [i for i in receivers['data'] if i['receiver'] == receiver]
        receivers['data'] = data
        #################################################################
        return jsonify(receivers)
Ejemplo n.º 6
0
def get_receiver():
    #################################################################
    receivers = raw_data.load_data('data/receiver.json')
    #################################################################
    return jsonify(receivers)
Ejemplo n.º 7
0
def delete_battery_setting():
    receiver_sn = request.args.get('receiver_sn')
    battery_setting_data = raw_data.load_data('data/battery_setting.json')
    return jsonify(battery_setting_data)
Ejemplo n.º 8
0
def get_battery_setting():
    battery_setting_data = raw_data.load_data('data/battery_setting.json')
    return jsonify(battery_setting_data)