use sensor_id and sensor_name from database
authorgregor herrmann <gregor@toastfreeware.priv.at>
Fri, 1 Jun 2018 23:50:51 +0000 (01:50 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Fri, 1 Jun 2018 23:50:51 +0000 (01:50 +0200)
web/seepark_web.py
web/static/seepark_web.js

index 74daa2fdc248ecb7625818ad22dd01b2fa0be295..910f0a9110912a50e0b03fdc0cacecc894d7d0d9 100644 (file)
@@ -4,10 +4,10 @@ app = Flask(__name__)
 @app.route("/data")
 def data():
     data = {
-        'water_temperature': [20, 19, 20, 21, 20, 21],
-        'water_temperature_x': ['2018-05-20', '2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-27'],
-        'air_temperature': [27, 32, 26, 29, 30, 31],
-        'air_temperature_x': ['2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-25', '2018-05-27'],
+        '0316a2193bff': [20, 19, 20, 21, 20, 21],
+        '0316a2193bff_x': ['2018-05-20', '2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-27'],
+        '0316a21383ff': [27, 32, 26, 29, 30, 31],
+        '0316a21383ff_x': ['2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-25', '2018-05-27'],
         }
     return jsonify(data)
 
index 3494dbb89525507aaafd29316ee494bc4f419ecd..c266172842bdc6a9e1a0c0f2cb30bb6439ddebd9 100644 (file)
@@ -7,12 +7,12 @@ var chart = c3.generate({
                url: '/data',
                mimeType: 'json',
                xs: {
-                       'water_temperature': 'water_temperature_x',
-                       'air_temperature': 'air_temperature_x'
+                       '0316a2193bff': '0316a2193bff_x',
+                       '0316a21383ff': '0316a21383ff_x'
                },
                names: {
-                       'water_temperature': 'Wassertemperatur',
-                       'air_temperature': 'Lufttemperatur'
+                       '0316a2193bff': 'Wassertemperatur in 4 m Tiefe',
+                       '0316a21383ff': 'Wassertemperatur in 5 m Tiefe'
                }
        },
        axis: {