Allows my home wiz lights to be timed on and off according to a schedule.

Dependents:   heating

Revision:
2:d3fe00659967
Parent:
1:a6b120e4031a
Child:
3:d33dda272a7f
--- a/web/web-wiz-html.c	Tue May 11 11:02:48 2021 +0000
+++ b/web/web-wiz-html.c	Thu May 13 19:09:24 2021 +0000
@@ -35,18 +35,23 @@
 
 static void addSchedule(int index)
 {
-    HttpAddText("<div style='display:flex;'>\r\n");
-    HttpAddF   ("  <input type='text' style='width:6em;' id='sched-name-%d' onchange='AjaxSendNameValue(\"snam%d\", this.value)'>\r\n", index, index);
-    HttpAddF   ("  <input type='text' style='width:4em;' id='sched-on-%d' onchange='AjaxSendNameValue(\"s-on%d\", this.value)'>\r\n", index, index);
-    HttpAddF   ("  <input type='text' style='width:4em;' id='sched-off-%d' onchange='AjaxSendNameValue(\"soff%d\", this.value)'>\r\n", index, index);
-    HttpAddF   ("  <div style='width:4em; text-align:right;' id='act-on-%d'></div>\r\n", index);
-    HttpAddF   ("  <div style='width:4em; text-align:right;' id='act-off-%d'></div>\r\n", index);
-    HttpAddF   ("  <div style='width:4em; text-align:right;' id='duration-%d'></div>\r\n", index);
-    HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"sdel%d\", \"1\")'>x</button>\r\n", index);
-    HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"smov%d\", \"up\")'>^</button>\r\n", index);
-    HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"smov%d\", \"down\")'>v</button>\r\n", index);
-    HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"sswi%d\", \"1\")'>1</button>\r\n", index);
-    HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"sswi%d\", \"0\")'>0</button>\r\n", index);
+    HttpAddText("<div style='display:flex; align-items:center;'>\r\n");
+    HttpAddF   ("  <input type='text' style='width:4.5em;' id='sched-name-%d' onchange='AjaxSendNameValue(\"snam%d\", this.value)'>\r\n", index, index);
+    HttpAddF   ("  <input type='text' style='width:3.5em;' id='sched-on-%d' onchange='AjaxSendNameValue(\"s-on%d\", this.value)'>\r\n", index, index);
+    HttpAddF   ("  <input type='text' style='width:3.5em;' id='sched-off-%d' onchange='AjaxSendNameValue(\"soff%d\", this.value)'>\r\n", index, index);
+    HttpAddF   ("  <div style='width:3.5em; text-align:right;' id='act-on-%d'></div>\r\n", index);
+    HttpAddF   ("  <div style='width:3.5em; text-align:right;' id='act-off-%d'></div>\r\n", index);
+    HttpAddF   ("  <div style='width:3.5em; text-align:right;' id='duration-%d'></div>\r\n", index);
+    //HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"sdel%d\", \"1\")'>x</button>\r\n", index);
+    //HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"smov%d\", \"up\")'>^</button>\r\n", index);
+    //HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"smov%d\", \"down\")'>v</button>\r\n", index);
+    //HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"sswi%d\", \"1\")'>1</button>\r\n", index);
+    //HttpAddF   ("  <button style='width:0.8em; margin-bottom: 0.1em; margin-top:0em; margin-left:0.5em; padding:0;' onclick='AjaxSendNameValue(\"sswi%d\", \"0\")'>0</button>\r\n", index);
+    addButton("sswi", index, "1", "1");
+    addButton("sswi", index, "0", "0");
+    addButton("sdel", index, "1", "x");
+    addButton("smov", index, "up", "^");
+    addButton("smov", index, "down", "v");
     HttpAddText("</div>\r\n");
 }