read main(water)sensor from ini file
authorgregor herrmann <gregor@toastfreeware.priv.at>
Thu, 5 Jul 2018 17:37:59 +0000 (19:37 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Thu, 5 Jul 2018 18:27:34 +0000 (20:27 +0200)
[temperature]
mainsensor=0316a21383ff

web/seepark_web.py

index f53585ec0ca782539d3d153d31768b36cc3e014a..de719ba0022292d79d7c296ee6660321e19a47ae 100644 (file)
@@ -39,6 +39,7 @@ config = configparser.ConfigParser()
 config.read(os.environ['SEEPARKINI'])
 apikey = config.get('openweathermap', 'apikey')
 cityid = config.get('openweathermap', 'cityid')
+mainsensor = config.get('temperature', 'mainsensor')
 
 app = Flask(__name__)
 app.json_encoder = JSONEncoder
@@ -180,7 +181,7 @@ def data(timespan):
 @app.route("/")
 def index():
     airvalue, airtime     = currentairtemperature(apikey, cityid)
-    watervalue, watertime = currentwatertemperature('0316a21383ff') # config? mainwatertemp?
+    watervalue, watertime = currentwatertemperature(mainsensor)
 
     return render_template(
         'seepark_web.html',