From: gregor herrmann Date: Wed, 5 Sep 2018 21:33:52 +0000 (+0200) Subject: add 2 new routes /api//current{air,water}temperature X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/commitdiff_plain/95644459a62e2d9bc8219e714f24ce1307727a38 add 2 new routes /api//current{air,water}temperature to get timestamp and value of current temperatures --- 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)