aboutsummaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/app.py b/app.py
index e2601ac..1d2853c 100644
--- a/app.py
+++ b/app.py
@@ -42,5 +42,10 @@ def api_get_watt_chart():
with database.PowerDatabase(host = devices.HOST) as db:
return flask.jsonify(db.get_watt_chart())
+@app.route("/api/longterm_chart")
+def api_get_kwh_chart():
+ with database.PowerDatabase(host = devices.HOST) as db:
+ return flask.jsonify(db.get_kwh_chart())
+
if __name__ == "__main__":
app.run(host = "0.0.0.0", port = int(os.environ["APP_PORT"]), debug = True) \ No newline at end of file