diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2023-12-24 14:46:04 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-12-24 14:46:04 +0000 |
commit | a1e03826c0a904b93d60bd8d44f14cc6ba087314 (patch) | |
tree | 4a01fb95a428b0d88cb79a4c5ad82b1334b3f714 /app.py | |
parent | f9da9ab448f59580180a46d2a9efc099ff09beb3 (diff) | |
download | power.eda.gay-a1e03826c0a904b93d60bd8d44f14cc6ba087314.tar.gz power.eda.gay-a1e03826c0a904b93d60bd8d44f14cc6ba087314.zip |
Added SNMP client for monitoring omada switches
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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 |