This commit is contained in:
mattbk
2017-11-17 22:55:32 +00:00
parent 67a854c474
commit 07be441922

View File

@ -68,12 +68,6 @@ def lab_temp():
return render_template("no_sensor.html") return render_template("no_sensor.html")
@app.route("/history", methods=['GET']) #Add date limits in the URL #Arguments: from=2015-03-04&to=2015-03-05 @app.route("/history", methods=['GET']) #Add date limits in the URL #Arguments: from=2015-03-04&to=2015-03-05
def change_tz(record):
local_timedate_series = arrow.get(record[0], "YYYY-MM-DD HH:mm").to(timezone)
time_series_adjusted_temperatures.append(local_timedate_series.format('YYYY-MM-DD HH:mm'))
time_series_temperature_values.append(round(record[2],2))
return {'time':time_series_adjusted_temperatures,'value':time_series_temperature_values} #this is a dict
def history(): def history():
temperatures, humidities, timezone, from_date_str, to_date_str = get_records() temperatures, humidities, timezone, from_date_str, to_date_str = get_records()
@ -96,8 +90,8 @@ def history():
temp = Scatter( temp = Scatter(
x=local_timedate_series['time'], x=local_timedate_series,
y=local_timedate_series['value'], y=time_series_temperature_values,
name='Temperature', name='Temperature',
mode='lines', mode='lines',
line=Line(color='red') line=Line(color='red')