From bbeeebb51fc9eb84cb976cb49ab2935f332f94ed Mon Sep 17 00:00:00 2001 From: jwansek Date: Sun, 8 Oct 2023 20:52:46 +0100 Subject: Started work on index --- app.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app.py') 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 -- cgit v1.2.3