Format air temperature and time values in template.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 4 Jul 2018 19:06:26 +0000 (21:06 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Wed, 4 Jul 2018 19:06:26 +0000 (21:06 +0200)
web/seepark_web.py
web/templates/seepark_web.html

index c0fd440d4da1e5f770c954fdb2d7c6ecc4295c29..3ca0b51eb547d7e20a062442633c00409a98d412 100644 (file)
@@ -188,7 +188,6 @@ def data(timespan):
 @app.route("/")
 def index():
     airvalue, airtime     = currentairtemperature(apikey, cityid)
 @app.route("/")
 def index():
     airvalue, airtime     = currentairtemperature(apikey, cityid)
-    airvalue              = "{:.1f}".format(airvalue) if isinstance(airvalue, float) else airvalue
     watervalue, watertime = currentwatertemperature('0316a21383ff') # config? mainwatertemp?
     watervalue            = "{:.1f}".format(watervalue) if isinstance(watervalue, float) else watervalue
 
     watervalue, watertime = currentwatertemperature('0316a21383ff') # config? mainwatertemp?
     watervalue            = "{:.1f}".format(watervalue) if isinstance(watervalue, float) else watervalue
 
index 7715013e18ab98dba9fd3617eb75dddccf162a9c..2fccfd6ba030e78be45265bbf5e82cdf4886ef4b 100644 (file)
@@ -29,8 +29,8 @@
                        {% if airvalue is none %}
                        <strong>Luft: N/A</strong>
                        {% else %}
                        {% if airvalue is none %}
                        <strong>Luft: N/A</strong>
                        {% else %}
-                       <strong>Luft: {{ airvalue }}°C</strong><br />
-                       <small>({{ airtime }})</small>
+                       <strong>Luft: {{ airvalue|round(1) }}°C</strong><br />
+                       <small>({{ airtime.strftime('%Y-%m-%d %H:%M') }})</small>
                        {% endif %}
                </p>
                <p id="currentwater">
                        {% endif %}
                </p>
                <p id="currentwater">