From 07a899ad61e292260bd8aff4ca73217662a323d6 Mon Sep 17 00:00:00 2001
From: Jakob Stendahl <jakob.stendahl@outlook.com>
Date: Wed, 13 Oct 2021 08:12:38 +0200
Subject: :lipstick: Add Trigger variable, fix small UI bug

---
 src_frontend/Components/MainControls/ControlComponents.svelte | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src_frontend/Components/MainControls/ControlComponents.svelte')

diff --git a/src_frontend/Components/MainControls/ControlComponents.svelte b/src_frontend/Components/MainControls/ControlComponents.svelte
index 65bd1c4..71c522a 100644
--- a/src_frontend/Components/MainControls/ControlComponents.svelte
+++ b/src_frontend/Components/MainControls/ControlComponents.svelte
@@ -19,6 +19,7 @@
     let activeMode = "";
     
     let colorVariables = {};
+    let variables = {};
 
     function togglePower() {
         powerIsOn = !powerIsOn;
@@ -54,6 +55,13 @@
                 }
                     colorVariables = colorVariables;
                 break;
+            default:
+                if (value.value == null) {
+                    delete variables[name];
+                } else {
+                    variables[name] = value.value;
+                }
+                variables = variables;
         }
     }
     openSocket.on("modelist", (modelist) => {
@@ -135,5 +143,5 @@
     {#if Object.keys(colorVariables).length > 0}
         <ControlColors on:change={setColor} bind:colorVariables={colorVariables} />
     {/if}
-    <!-- <ControlOthers /> -->
+    <ControlOthers />
 </div>
\ No newline at end of file
-- 
cgit v1.2.3

