コード例 #1
0
ファイル: app.py プロジェクト: qitianchan/LoRaGPSDemo
def devices_lnglat():
    data = []
    devices = Device.get_devices()
    for device in devices:
        d = {}
        d['device_id'] = device.id
        d['lng'] = device.lng
        d['lat'] = device.lat
        d['name'] = device.name
        if device.type == NODE:
            d['icon_uri'] = url_for('static', filename=NODE_IMG_URI)
        else:
            d['icon_uri'] = url_for('static', filename=BASESTATION_IMG_URI)
        data.append(d)
    return jsonify({'data': data})
コード例 #2
0
ファイル: app.py プロジェクト: qitianchan/LoRaGPSDemo
def devices():
    devices = Device.get_devices()
    return render_template('devices.html', devices=devices)