aboutsummaryrefslogtreecommitdiffstats
path: root/app.py
blob: d67cbacae09b322487744ee61b7878d0dd467fb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)