aboutsummaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-10-08 20:52:46 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2023-10-08 20:52:46 +0100
commitbbeeebb51fc9eb84cb976cb49ab2935f332f94ed (patch)
treecd37aafcacd9b0c1e259a5c9a697f1cd5af2b68a /app.py
parent8d804ec551d8866325a56643adae34d399280327 (diff)
downloadpower.eda.gay-bbeeebb51fc9eb84cb976cb49ab2935f332f94ed.tar.gz
power.eda.gay-bbeeebb51fc9eb84cb976cb49ab2935f332f94ed.zip
Started work on index
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