finally drop old "API" with random data
authorgregor herrmann <gregor@toastfreeware.priv.at>
Sun, 5 Aug 2018 17:08:30 +0000 (19:08 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Sun, 5 Aug 2018 17:09:23 +0000 (19:09 +0200)
web/seepark_web.py

index b1329602fcd089356dc1fcae021487832c91c2f8..bb597324065e5ae81cd3ed65fbf75e8c297aeacb 100644 (file)
@@ -1,4 +1,3 @@
-from random import uniform
 import datetime
 import time
 import configparser
@@ -239,36 +238,6 @@ def openweathermap_city(version, cityid):
     return jsonify(result)
 
 
-@app.route('/data/', defaults={'timespan': 1})
-@app.route("/data/<int:timespan>", methods=['GET'])
-def data(timespan):
-    granularity = 5 * timespan               # (every) minute(s) per day
-    samples = 60/granularity * 24 * timespan # per hour over whole timespan
-    s4m   = []
-    s4m_x = []
-    s5m   = []
-    s5m_x = []
-    end   = time.time()
-    start = end - samples * granularity * 60
-
-    for i in range(int(samples)):
-        s4m.append(uniform(-10,30))
-        s5m.append(uniform(-10,30))
-        s4mt = uniform(start, end)
-        s5mt = uniform(start, end)
-        s4m_x.append(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(s4mt)))
-        s5m_x.append(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(s5mt)))
-
-    data = {
-        '0316a2193bff':   s4m,
-        '0316a2193bff_x': s4m_x,
-        '0316a21383ff':   s5m,
-        '0316a21383ff_x': s5m_x,
-        }
-
-    return jsonify(data)
-
-
 @app.route("/")
 def index():
     airvalue, airtime     = currentairtemperature(cityid)