aboutsummaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/app.py b/app.py
new file mode 100644
index 0000000..d67cbac
--- /dev/null
+++ b/app.py
@@ -0,0 +1,17 @@
+import database
+import devices
+import flask
+import os
+
+app = flask.Flask(__name__)
+
+@app.route("/")
+def route_index():
+ with database.PowerDatabase(host = devices.HOST) as db:
+ return flask.render_template(
+ "index.html.j2",
+ tasmota_devices = db.get_tasmota_devices()
+ )
+
+if __name__ == "__main__":
+ app.run(host = "0.0.0.0", port = int(os.environ["APP_PORT"]), debug = True) \ No newline at end of file