+
-
-
-
-
-
+
+
+
+
+ {% for powerbar in powerbars.items() %}
+
+
+
+
+
+
+
+
+ {% for outlet in powerbar[1].outlets.items() %}
+
+ -
+
+
+ {% endfor %}
+
+
+
+
+
+
+
+ {% endfor %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/views.py b/app/views.py
index 508cbe5..96cb984 100644
--- a/app/views.py
+++ b/app/views.py
@@ -29,7 +29,18 @@ def vaild_outlet (powerbar, outlet):
@routes.route('/')
def home():
- return render_template('index.html')
+
+ all_groups = []
+
+ for powerbar in powerbars:
+ for outlet in powerbars[powerbar]['outlets']:
+ powerbars[powerbar]['outlets'][outlet]['state'] = powerbars[powerbar]['outlets'][outlet].get('state', 'unknown')
+
+ for group in powerbars[powerbar]['groups']:
+ all_groups.append(group)
+
+
+ return render_template('index.html', powerbars=powerbars, all_groups=all_groups)