From 95644459a62e2d9bc8219e714f24ce1307727a38 Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Wed, 5 Sep 2018 23:33:52 +0200 Subject: [PATCH 1/1] add 2 new routes /api//current{air,water}temperature to get timestamp and value of current temperatures --- web/seepark_web.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/seepark_web.py b/web/seepark_web.py index 59e0c8b..b4c7749 100644 --- a/web/seepark_web.py +++ b/web/seepark_web.py @@ -262,6 +262,18 @@ def openweathermap_city(version, cityid): return jsonify(result) +@app.route('/api//currentairtemperature') +def currentair(version): + value, timestamp = currentairtemperature(cityid) + return jsonify({"value": value, "timestamp": timestamp}) + + +@app.route('/api//currentwatertemperature') +def currentwater(version): + value, timestamp = currentwatertemperature(mainsensor) + return jsonify({"value": value, "timestamp": timestamp}) + + @app.route("/") def index(): airvalue, airtime = currentairtemperature(cityid) -- 2.47.3