diff --git a/influx_frontend.py b/influx_frontend.py index 2adb7e9..f8c93df 100644 --- a/influx_frontend.py +++ b/influx_frontend.py @@ -126,8 +126,8 @@ def add_time(): return redirect(url_for('main_page')) -@app.route('/repeat_last_odometer/') -def repeat_last_odometer(odometer): +@app.route('/repeat_last_odometer//') +def repeat_last_odometer(odometer, winter=False): '''Retrieve the passed in odometer value and submit as a new entry''' date = strftime("%Y-%m-%d") time = strftime("%H:%M:%S") @@ -136,7 +136,7 @@ def repeat_last_odometer(odometer): write_api = client.write_api(write_options=SYNCHRONOUS) point = influxdb_client.Point("2016_odyssey").time( - timestamp).field("odometer", float(odometer)) + timestamp).tag("winter", winter).field("odometer", float(odometer)) write_api.write(bucket="gas", org=config['DB_ORG'], record=point) return redirect(url_for('main_page')) diff --git a/templates/index.html b/templates/index.html index 9b1cbe3..cd3d65d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -57,13 +57,16 @@ {% endif %} + {% else %} + + {% endif %}
{% if data %} - Repeat + Repeat {% endif %}