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")
@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():
temperatures, humidities, timezone, from_date_str, to_date_str = get_records()
@ -96,8 +90,8 @@ def history():
temp = Scatter(
x=local_timedate_series['time'],
y=local_timedate_series['value'],
x=local_timedate_series,
y=time_series_temperature_values,
name='Temperature',
mode='lines',
line=Line(color='red')