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)
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)
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)
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)
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)
def get_receiver(): ################################################################# receivers = raw_data.load_data('data/receiver.json') ################################################################# return jsonify(receivers)
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)
def get_battery_setting(): battery_setting_data = raw_data.load_data('data/battery_setting.json') return jsonify(battery_setting_data)