From a1e03826c0a904b93d60bd8d44f14cc6ba087314 Mon Sep 17 00:00:00 2001 From: jwansek Date: Sun, 24 Dec 2023 14:46:04 +0000 Subject: Added SNMP client for monitoring omada switches --- app.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app.py (limited to 'app.py') 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 -- cgit v1.2.3