We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 10e5012 commit 172901dCopy full SHA for 172901d
flask_server.py
@@ -275,7 +275,20 @@ def get_data(data_type):
275
return data_dictionary
276
277
278
-@app.route('/data/<data_type>')
+@app.route('/ui/')
279
+def output_ui_variables()
280
+ data_dictionary = get_data("ui")
281
+
282
+ # calculate fuel percentage
283
+ fuel_quantity = data_dictionary.get("FUEL_TOTAL_QUANTITY")
284
+ fuel_capacity = data.dictionary.get("FUEL_TOTAL_CAPACITY")
285
+ fuel_percantage = fuel quantity / fuel_capacity
286
287
+ data_dictionary["FUEL_PERCENTAGE"] = fuel_percantage
288
+ return jsonify(data_dictionary)
289
290
291
+@app.route('/data/<data_type>/')
292
def output_detailed_json_data(data_type):
293
294
data_dictionary = get_data(data_type)
0 commit comments