Commit 03640ff1 authored by Alan Mitchell's avatar Alan Mitchell

Multi-sensor reading API endpoint added.

Also added API version endpoint.
parent b8475f4c
......@@ -255,7 +255,7 @@ class BMSdata:
df_final = pd.merge(df_final, df, how='outer', left_index=True, right_index=True)
# convert the timezone of the index if requested
if tz:
if tz and len(df_final) > 0:
# Convert the dates to the specified timezone...
# But, for some reason pandas resampling sometimes fails if the datetime index is timezone aware,
# so after converting the dates we make them timezone naive again.
......
......@@ -33,7 +33,9 @@ urlpatterns = [
re_path(r'^backup-readings/$', views.backup_reading_db),
# Views related to the API, version 1
re_path(r'^api/v1/version/$', views_api_v1.api_version),
re_path(r'^api/v1/readings/(.+)/$', views_api_v1.sensor_readings),
re_path(r'^api/v1/readings/$', views_api_v1.sensor_readings_multiple),
re_path(r'^api/v1/sensors/$', views_api_v1.sensor_list),
# catches URLs that don't match the above patterns. Assumes they give a template name to render.
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment