diff options
| -rw-r--r-- | main.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -3,8 +3,10 @@ import heating import errors import sql import weather +import time from flask import Flask, render_template +from threading import Thread app = Flask(__name__) @@ -74,6 +76,13 @@ def export(opt): "error.html", error="Invalid export type" ) +def updater(): + while True: + boiler.update() + time.sleep(5) if __name__ == "__main__": - app.run(host="0.0.0.0") + t1 = Thread(target=app.run, args=(host=host="0.0.0.0",)) + t2 = Thread(target=updater) + t1.start() + t2.start() |
