From 26d679e062ff95afdbd97341ec351187c31f1bfb Mon Sep 17 00:00:00 2001 From: Matthew Frost Date: Sun, 19 Nov 2023 17:49:38 +0100 Subject: [PATCH] basic app --- app/templates/index.html | 52 +++++++++++++++++++++++++++++++++++----- app/views.py | 2 ++ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/app/templates/index.html b/app/templates/index.html index 049f5e0..81f7f95 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -162,11 +162,37 @@ input:checked + .slider:before { {% endfor %} + + {% if all_groups %} +
+
+
+

Groups

+ {% for group in all_groups %} +
  • +
    +
    {{group.name}}
    +
    +
    + + +
    +
    +
    +
    +
  • + {% endfor %} +
    +
    + {% endif %} +
    + + @@ -174,18 +200,32 @@ input:checked + .slider:before { diff --git a/app/views.py b/app/views.py index 96cb984..e4bb66e 100644 --- a/app/views.py +++ b/app/views.py @@ -37,6 +37,8 @@ def home(): powerbars[powerbar]['outlets'][outlet]['state'] = powerbars[powerbar]['outlets'][outlet].get('state', 'unknown') for group in powerbars[powerbar]['groups']: + + group["powerbar"] = powerbar all_groups.append(group)