From 65c07d9fdac4d54e4c6e1afd1fbf36411d8e5bbe Mon Sep 17 00:00:00 2001 From: White Red Date: Sat, 9 Nov 2024 22:41:31 +0200 Subject: [PATCH 01/11] restructured the miscellaneous section under tabs --- data/misc.html | 245 ++++++++++++++++++++++++++----------------------- 1 file changed, 128 insertions(+), 117 deletions(-) diff --git a/data/misc.html b/data/misc.html index 9c767ca..5c6c9b2 100644 --- a/data/misc.html +++ b/data/misc.html @@ -4,94 +4,118 @@
Changes in this section will reboot style="display: inline-flex; flex-direction: column; margin-bottom: 0">
-

Personalization

-
-

HomeKit

-
- - +

General settings

+
+
+
+

HomeKit

+

PN532

+

HomeSpan

+
+
+
+
+ + +
-
- - -
+
+ + +
-
- - -
-
- - -
-
- HomeKey Card Finish: -
-
-
-
-
- - -
-
- - -
-
- - +
+ + +
+
+ + +
+
+ HomeKey Card Finish: +
+
-
- - +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
-
-
-

PN532

-
-
- - -
-
- - +
+
+ HomeSpan Documentation +
+ +
-
- - +
+ +
-
- - + +
+ +
@@ -100,49 +124,36 @@

WebUI

-
- - -
-
- - -
-
- - -
-
-
-
-

HomeSpan

-
-
- - -
-
- - + style="display:flex;flex-direction: column;margin-bottom: 1rem;gap: 8px;"> +
+
+

Authentication

+
+
- -
- - +
+
+ + +
+
+ + +
+
+ + +
-
+
From 648c1c4ef3af99c68e69e8722d451197a4ce6d20 Mon Sep 17 00:00:00 2001 From: White Red Date: Sat, 9 Nov 2024 22:41:44 +0200 Subject: [PATCH 02/11] wording --- data/actions.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/actions.html b/data/actions.html index 2b4b2e6..453892b 100644 --- a/data/actions.html +++ b/data/actions.html @@ -126,7 +126,7 @@

Simple GPIO

HomeKit Triggers

-

Executed upon interaction in the Home app and in addition also on successful HomeKey Authentication

+

Executed upon interaction in the Home app and optionally on successful HomeKey Authentication(enabled by default)

Follows "Always Lock/Unlock on HomeKey" option

Momentary state is only available with LOCKED as initial state

@@ -150,7 +150,7 @@

Simple GPIO

- + +
From e3778de02e0d2096410cd04b5a1415e33ed5c7e3 Mon Sep 17 00:00:00 2001 From: White Red Date: Sun, 10 Nov 2024 15:13:16 +0200 Subject: [PATCH 03/11] switching tabs --- data/index.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/index.html b/data/index.html index 43ad6a7..c577230 100644 --- a/data/index.html +++ b/data/index.html @@ -24,6 +24,16 @@ } wifiSignalStrength(); setInterval(wifiSignalStrength, 5000) + function switchTab(el) { + var parentId = el.parentElement.id; + document.querySelector(`.${parentId}-selected-body`).style.display = "none"; document.querySelector(`.${parentId}-selected-body`).className = ""; + document.querySelector(`div[data-${parentId}-body="${el.dataset.tabIndex}"]`).style.display = "flex"; + document.querySelector(`div[data-${parentId}-body="${el.dataset.tabIndex}"]`).classList.add(`${parentId}-selected-body`); + document.querySelector(`.${parentId}-selected`).style.borderBottom = ""; + document.querySelector(`.${parentId}-selected`).className = ""; + el.classList.add(`${parentId}-selected`); + el.style.borderBottom = "2px #8e8271 solid"; + } async function addComponent(name, button) { let loaderEl = document.createElement("span") loaderEl.className = "loader"; From d8d1f11af87a703cc2dae0a1c42732a4bbf65eae Mon Sep 17 00:00:00 2001 From: White Red Date: Sun, 10 Nov 2024 16:23:55 +0200 Subject: [PATCH 04/11] mqtt section reorganizing --- data/mqtt.html | 253 +++++++++++++++++++++++++------------------------ 1 file changed, 131 insertions(+), 122 deletions(-) diff --git a/data/mqtt.html b/data/mqtt.html index 424f1a8..a515a72 100644 --- a/data/mqtt.html +++ b/data/mqtt.html @@ -1,149 +1,158 @@

MQTT Configuration

Changes in this section will reboot the device
-
-

Broker Connection

-
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
-
- - -
-
-
-
-

MQTT Topics

-
-

Core Topics

-
+ style="display: inline-flex; flex-direction: column;margin-bottom: 0;align-items: center;"> +
+
+

Broker Connection

+
- - + +
-
- - -
- - + +
- - + +
+
+ + +
+
+
- - + +
- - + +
-
-
-

Custom State Topics

-
-
- -
-
- - +
+
+
+

MQTT Topics

+
+
+

Core Topics

+

Custom Topics

+
+ +
+
+
+
+ + +
+
+ +
-
- - +
+ + +
+
+ + +
+
+ + +
+
+ + +
- -
-
- Custom Lock Actions -
-
- - -
-
- - -
+
+
+
+ +
-
-
- Custom Lock States -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - +
+ + +
+
+ + +
+
+
+
+ Custom Lock Actions +
+
+ + +
+
+ + +
-
- - +
+
+ Custom Lock States +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
-
+ +
From 44876bcf089adac93039d72d1003dc1d49d5a92a Mon Sep 17 00:00:00 2001 From: White Red Date: Sun, 10 Nov 2024 16:24:13 +0200 Subject: [PATCH 05/11] actions section reorganized --- data/actions.html | 229 ++++++++++++++++++++++++---------------------- 1 file changed, 122 insertions(+), 107 deletions(-) diff --git a/data/actions.html b/data/actions.html index 453892b..0998cfd 100644 --- a/data/actions.html +++ b/data/actions.html @@ -9,128 +9,143 @@
Assigning 255

HomeKey/NFC Triggers

Executed on successful/failed HomeKey Authentication and on NFC Tag detection(marked as a failed event)

Both Neopixel and Simple GPIO have a momentary state

-
-

Neopixel

-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-

Auth Success Color

+
+
+

Neopixel

+

Simple GPIO

+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+

Auth Success Color

+
+
+
+ +
-
-
- - -
-
- - -
-
- - -
+
+ +
+
+ + +
+
+
+ +
+
+

Auth Failure Color

- -
-
-

Auth Failure Color

+
+
+ +
-
-
- - -
-
- - -
-
- - -
+
+ + +
+
+ +
+
-
-

Simple GPIO

-
-
-
- Auth Success -
- - -
-
- - -
-
- - -
-
-
-
-
- Auth Failure -
- - -
-
- - -
-
- - -
-
-
+

HomeKit Triggers

Executed upon interaction in the Home app and optionally on successful HomeKey Authentication(enabled by default)

-

Follows "Always Lock/Unlock on HomeKey" option

-

Momentary state is only available with LOCKED as initial state

-
-

Simple GPIO

+
+
+

Simple GPIO

+
+ +
+
+
* This follows "Always Lock/Unlock on HomeKey" option
+
** Momentary state applies only if initial state is "LOCKED"
From e14f96883fd38a1a54d3502fdd50fbc347bf8dc7 Mon Sep 17 00:00:00 2001 From: White Red Date: Mon, 11 Nov 2024 13:38:30 +0200 Subject: [PATCH 06/11] moved html segments to routes folder --- data/index.html | 4 ++-- data/{ => routes}/actions.html | 0 data/{ => routes}/info.html | 0 data/{ => routes}/misc.html | 0 data/{ => routes}/mqtt.html | 0 src/main.cpp | 8 ++++---- 6 files changed, 6 insertions(+), 6 deletions(-) rename data/{ => routes}/actions.html (100%) rename data/{ => routes}/info.html (100%) rename data/{ => routes}/misc.html (100%) rename data/{ => routes}/mqtt.html (100%) diff --git a/data/index.html b/data/index.html index c577230..62aecc1 100644 --- a/data/index.html +++ b/data/index.html @@ -41,7 +41,7 @@ document.querySelector("#main > span").insertAdjacentElement("afterend",loaderEl); let element = document.querySelector("#component"); if(element){ - element.remove(); + element.remove(); } let sel = document.querySelector(".selected-btn"); if(sel){ @@ -51,7 +51,7 @@ let el = document.createElement("div"); el.id = "component"; el.style = "display: flex;flex-direction: column;max-width: 32rem;margin-bottom: 1rem;"; - let data = await fetch(name); + let data = await fetch(`${name}`); let string = await data.text(); el.innerHTML = string; main.appendChild(el); diff --git a/data/actions.html b/data/routes/actions.html similarity index 100% rename from data/actions.html rename to data/routes/actions.html diff --git a/data/info.html b/data/routes/info.html similarity index 100% rename from data/info.html rename to data/routes/info.html diff --git a/data/misc.html b/data/routes/misc.html similarity index 100% rename from data/misc.html rename to data/routes/misc.html diff --git a/data/mqtt.html b/data/routes/mqtt.html similarity index 100% rename from data/mqtt.html rename to data/routes/mqtt.html diff --git a/src/main.cpp b/src/main.cpp index 9e88680..50a8449 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -946,16 +946,16 @@ String actionsProcess(const String& var) { } bool headersFix(AsyncWebServerRequest* request) { request->addInterestingHeader("ANY"); return true; }; void setupWeb() { - auto infoHandle = new AsyncStaticWebHandler("/info", LittleFS, "/info.html", NULL); + auto infoHandle = new AsyncStaticWebHandler("/info", LittleFS, "/routes/info.html", NULL); webServer.addHandler(infoHandle); infoHandle->setTemplateProcessor(hkInfoHtmlProcess).setFilter(headersFix); - auto mqttHandle = new AsyncStaticWebHandler("/mqtt", LittleFS, "/mqtt.html", NULL); + auto mqttHandle = new AsyncStaticWebHandler("/mqtt", LittleFS, "/routes/mqtt.html", NULL); webServer.addHandler(mqttHandle); mqttHandle->setTemplateProcessor(mqttHtmlProcess).setFilter(headersFix); - auto miscHandle = new AsyncStaticWebHandler("/misc", LittleFS, "/misc.html", NULL); + auto miscHandle = new AsyncStaticWebHandler("/misc", LittleFS, "/routes/misc.html", NULL); webServer.addHandler(miscHandle); miscHandle->setTemplateProcessor(miscHtmlProcess).setFilter(headersFix); - auto actionsHandle = new AsyncStaticWebHandler("/actions", LittleFS, "/actions.html", NULL); + auto actionsHandle = new AsyncStaticWebHandler("/actions", LittleFS, "/routes/actions.html", NULL); webServer.addHandler(actionsHandle); actionsHandle->setTemplateProcessor(actionsProcess).setFilter(headersFix); auto assetsHandle = new AsyncStaticWebHandler("/assets", LittleFS, "/assets/", NULL); From a8f23a59290c0dab0fe576f982b21e2f247abc81 Mon Sep 17 00:00:00 2001 From: White Red Date: Mon, 11 Nov 2024 15:19:58 +0200 Subject: [PATCH 07/11] gpio pin form validation --- src/main.cpp | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 50a8449..97f79c9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1063,8 +1063,20 @@ void setupWeb() { } } } else if (!strcmp(p->name().c_str(), "control-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } espConfig::miscConfig.controlPin = p->value().toInt(); } else if (!strcmp(p->name().c_str(), "led-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } espConfig::miscConfig.hsStatusPin = p->value().toInt(); } else if (!strcmp(p->name().c_str(), "hk-always-unlock")) { espConfig::miscConfig.lockAlwaysUnlock = p->value().toInt(); @@ -1079,12 +1091,36 @@ void setupWeb() { } else if (!strcmp(p->name().c_str(), "web-auth-password")) { espConfig::miscConfig.webPassword = p->value().c_str(); } else if (!strcmp(p->name().c_str(), "nfc-ss-gpio-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } espConfig::miscConfig.nfcGpioPins[0] = p->value().toInt(); } else if (!strcmp(p->name().c_str(), "nfc-sck-gpio-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } espConfig::miscConfig.nfcGpioPins[1] = p->value().toInt(); } else if (!strcmp(p->name().c_str(), "nfc-miso-gpio-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } espConfig::miscConfig.nfcGpioPins[2] = p->value().toInt(); } else if (!strcmp(p->name().c_str(), "nfc-mosi-gpio-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } espConfig::miscConfig.nfcGpioPins[3] = p->value().toInt(); } } @@ -1110,6 +1146,12 @@ void setupWeb() { AsyncWebParameter* p = request->getParam(i); LOG(V, "POST[%s]: %s\n", p->name().c_str(), p->value().c_str()); if (!strcmp(p->name().c_str(), "nfc-neopixel-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } if (espConfig::miscConfig.nfcNeopixelPin == 255 && p->value().toInt() != 255) { xTaskCreate(neopixel_task, "neopixel_task", 4096, NULL, 2, &neopixel_task_handle); if (!pixel) { @@ -1143,6 +1185,12 @@ void setupWeb() { } else if (!strcmp(p->name().c_str(), "nfc-f-blue-pixel")) { espConfig::miscConfig.neopixelFailureColor[espConfig::misc_config_t::colorMap::B] = p->value().toInt(); } else if (!strcmp(p->name().c_str(), "nfc-s-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } if (espConfig::miscConfig.nfcSuccessPin == 255 && p->value().toInt() != 255 && gpio_led_task_handle == nullptr) { pinMode(p->value().toInt(), OUTPUT); xTaskCreate(nfc_gpio_task, "nfc_gpio_task", 4096, NULL, 2, &gpio_led_task_handle); @@ -1153,6 +1201,12 @@ void setupWeb() { } espConfig::miscConfig.nfcSuccessPin = p->value().toInt(); } else if (!strcmp(p->name().c_str(), "nfc-f-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } if (espConfig::miscConfig.nfcFailPin == 255 && p->value().toInt() != 255 && gpio_led_task_handle == nullptr) { pinMode(p->value().toInt(), OUTPUT); xTaskCreate(nfc_gpio_task, "nfc_gpio_task", 4096, NULL, 2, &gpio_led_task_handle); @@ -1171,6 +1225,12 @@ void setupWeb() { } else if (!strcmp(p->name().c_str(), "nfc-f-time")) { espConfig::miscConfig.nfcFailTime = p->value().toInt(); } else if (!strcmp(p->name().c_str(), "gpio-a-pin")) { + if (!GPIO_IS_VALID_GPIO(p->value().toInt()) && !GPIO_IS_VALID_OUTPUT_GPIO(p->value().toInt()) && p->value().toInt() != 255) { + std::string msg = p->value().c_str(); + msg.append(" is not a valid GPIO Pin"); + request->send(200, "text/plain", msg.c_str()); + return; + } if (espConfig::miscConfig.gpioActionPin == 255 && p->value().toInt() != 255) { pinMode(p->value().toInt(), OUTPUT); xTaskCreate(gpio_task, "gpio_task", 4096, NULL, 2, &gpio_lock_task_handle); @@ -1199,7 +1259,7 @@ void setupWeb() { LOG(V, "SET_STATUS: %s", esp_err_to_name(set_nvs)); LOG(V, "COMMIT_STATUS: %s", esp_err_to_name(commit_nvs)); - request->send(200, "text/plain", "Received Config!"); + request->send(200, "text/plain", "Configuration applied!"); }); webServer.addHandler(actionsConfigHandle); auto rebootDeviceHandle = new AsyncCallbackWebHandler(); From d5ed72283bfe6968cc99be1a9f73e335ec08b66e Mon Sep 17 00:00:00 2001 From: White Red Date: Mon, 11 Nov 2024 21:41:45 +0200 Subject: [PATCH 08/11] some fields alignment --- data/assets/misc.css | 9 ++++++++- data/index.html | 2 +- data/routes/mqtt.html | 25 +++++++++++++------------ src/main.cpp | 2 +- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/data/assets/misc.css b/data/assets/misc.css index c8dc6fb..a1c7cc7 100644 --- a/data/assets/misc.css +++ b/data/assets/misc.css @@ -71,6 +71,10 @@ button { #restart-btn:active { background-color: #4040402e!important; } + + #mqtt-broker-con, #mqtt-topics { + width: 23rem; + } } @media only screen and (max-width: 600px) { @@ -83,9 +87,12 @@ button { flex-wrap: wrap; justify-content: center; } + #mqtt-broker, #mqtt-topics { + width: auto; + } } -#mqtt-broker-conn { +.fill-container { width: 100%; width: -moz-available; width: -webkit-fill-available; diff --git a/data/index.html b/data/index.html index 62aecc1..a8bd532 100644 --- a/data/index.html +++ b/data/index.html @@ -1,5 +1,5 @@ - + diff --git a/data/routes/mqtt.html b/data/routes/mqtt.html index a515a72..9e5cd42 100644 --- a/data/routes/mqtt.html +++ b/data/routes/mqtt.html @@ -3,17 +3,19 @@
Changes in this section will reboot
-
-

Broker Connection

+
+

Broker Connection

+
TCP - Without TLS
-
- - -
-
- - +
+
+ + +
+
+ + +
@@ -44,8 +46,7 @@

Broker Connection

-
+

MQTT Topics

diff --git a/src/main.cpp b/src/main.cpp index 97f79c9..237c651 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1323,7 +1323,7 @@ void mqttConfigReset(const char* buf) { } void wifiCallback() { - if (espConfig::mqttData.mqttBroker.size() > 0 || !std::equal(espConfig::mqttData.mqttBroker.begin(), espConfig::mqttData.mqttBroker.end(), "0.0.0.0")) { + if (espConfig::mqttData.mqttBroker.size() >= 7 && espConfig::mqttData.mqttBroker.size() <= 16 && !std::equal(espConfig::mqttData.mqttBroker.begin(), espConfig::mqttData.mqttBroker.end(), "0.0.0.0")) { mqtt_app_start(); } setupWeb(); From f4c92376ae0fc2d0224e2ce2d5cb53a21eaea60b Mon Sep 17 00:00:00 2001 From: White Red Date: Wed, 13 Nov 2024 15:06:41 +0200 Subject: [PATCH 09/11] moved some inline css to a stylesheet and layout improvement --- data/assets/misc.css | 42 ++++- data/assets/restart.webp | Bin 746 -> 0 bytes data/index.html | 13 +- data/routes/actions.html | 336 ++++++++++++++++++++------------------- data/routes/misc.html | 270 ++++++++++++++++--------------- data/routes/mqtt.html | 40 ++--- 6 files changed, 367 insertions(+), 334 deletions(-) delete mode 100644 data/assets/restart.webp diff --git a/data/assets/misc.css b/data/assets/misc.css index a1c7cc7..4fe5c6a 100644 --- a/data/assets/misc.css +++ b/data/assets/misc.css @@ -59,7 +59,23 @@ button { border-color: hsl(240 3.7% 15.9%) !important; } -@media only screen and (min-width: 1200px) { +div[class$="-selected-body"] { + display: flex; + flex-direction: column; + padding-inline: 1rem; + padding-bottom: .5rem; + gap: 16px; +} + +h3[class$="-selected-tab"] { + border-bottom: 2px #8e8271 solid; +} + +div[class$="-hidden-body"] { + display: none; +} + +@media only screen and (min-width: 800px) { button:hover { opacity: .9; } @@ -72,8 +88,15 @@ button { background-color: #4040402e!important; } - #mqtt-broker-con, #mqtt-topics { - width: 23rem; + #mqtt-broker-con, #mqtt-topics-container { + min-width: 20rem; + max-width: 25rem; + } + .cards-container { + align-items: flex-start; + } + #component { + max-width: 65rem; } } @@ -90,6 +113,12 @@ button { #mqtt-broker, #mqtt-topics { width: auto; } + .cards-container { + flex-direction: column; + } + .nfc-triggers-selected-body { + flex-wrap: wrap; + } } .fill-container { @@ -99,6 +128,13 @@ button { width: fill-available; } +#buttons-group { + display: flex; + justify-content: center; + margin-top: 2rem; + gap: 64px; +} + .loader { width: 100%; diff --git a/data/assets/restart.webp b/data/assets/restart.webp deleted file mode 100644 index d83e40490dff0023522428d431dcdc7ae49fd2c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 746 zcmWIYbaQ*e#J~{l>J$(bVBvEW$kum0ARrL_XxXi8sXyo`y~v|(s!6YxSpGHd(|hP z0cT>J-!}>EVOQ$7qZIW)s?LM)%=v=+1Nx7*^~$*Go_|(R{+^q~u|>h7)I!Eiu3ywq z;L*p5ORvAy?u|=la1dxQn0R%*=y+%4KB0UZ{L^g zj^BJ!X4R@?DMl~PrZF=#EXojaHN5)z>zxb}uD-{thYkML*%!$4KmUBP!e-hc4b90X zmxQgJy6?U|L&N#!-p@ZvGAsyNooO`l&hf{IBCe{QlX%&jwMDpIeXT09n)|lKZg+%E zmDSubnd5)|*8Qy8e=@<~#rNNm3<;6bYV6iu%}U*TbItqj(lWjl8#8oq+<7 zpxU)aqpPposkc?*%MISiWl>Va-=8F3Hu1fDi=ZCDV@eUwHLtpKxe|!p_yPQc+X$Gq;@s zgS!7*+%<1YtmgVHH?Ep}w``J%=cJmf$g_7gmtWhZDE5BG;>o(J&wdw5J`Dz+KPNWc ze7fO4yR}iEh$|4iUl`Z){q5eTJF^4kJ+GYi{I7fJs;kzu`Gpe43uTV4F5h~~8{}|( zb_nn;-@2RYd(Qub_j>a)_oYWpOTC#;1OZAuQu&!RdZ#z(oSy%EU)B2`u{CwC%RgH8 X&pZnOaWk&uX8JHQ+&f$!#J~Ump~6`! diff --git a/data/index.html b/data/index.html index a8bd532..edf4e95 100644 --- a/data/index.html +++ b/data/index.html @@ -26,13 +26,10 @@ setInterval(wifiSignalStrength, 5000) function switchTab(el) { var parentId = el.parentElement.id; - document.querySelector(`.${parentId}-selected-body`).style.display = "none"; document.querySelector(`.${parentId}-selected-body`).className = ""; - document.querySelector(`div[data-${parentId}-body="${el.dataset.tabIndex}"]`).style.display = "flex"; - document.querySelector(`div[data-${parentId}-body="${el.dataset.tabIndex}"]`).classList.add(`${parentId}-selected-body`); - document.querySelector(`.${parentId}-selected`).style.borderBottom = ""; - document.querySelector(`.${parentId}-selected`).className = ""; - el.classList.add(`${parentId}-selected`); - el.style.borderBottom = "2px #8e8271 solid"; + document.querySelector(`.${parentId}-selected-body`).classList.replace(`${parentId}-selected-body`,`${parentId}-hidden-body`); + document.querySelector(`div[data-${parentId}-body="${el.dataset.tabIndex}"]`).classList.replace(`${parentId}-hidden-body`, `${parentId}-selected-body`); + document.querySelector(`.${parentId}-selected-tab`).className = ""; + el.classList.add(`${parentId}-selected-tab`); } async function addComponent(name, button) { let loaderEl = document.createElement("span") @@ -50,7 +47,7 @@ let main = document.querySelector("#main"); let el = document.createElement("div"); el.id = "component"; - el.style = "display: flex;flex-direction: column;max-width: 32rem;margin-bottom: 1rem;"; + el.style = "display: flex;flex-direction: column;margin-bottom: 1rem;"; let data = await fetch(`${name}`); let string = await data.text(); el.innerHTML = string; diff --git a/data/routes/actions.html b/data/routes/actions.html index 0998cfd..b9bc172 100644 --- a/data/routes/actions.html +++ b/data/routes/actions.html @@ -3,190 +3,192 @@

Hardware Actions

Assigning 255 to any Pin field will disable the respective option
- -
-

HomeKey/NFC Triggers

-

Executed on successful/failed HomeKey Authentication and on NFC Tag detection(marked as a failed event)

-

Both Neopixel and Simple GPIO have a momentary state

-
-
-

Neopixel

-

Simple GPIO

-
- -
-
-
- - -
-
- - -
-
- - -
-
- - +
+
+

HomeKey/NFC Triggers

+

Executed on successful/failed HomeKey Authentication and on NFC Tag detection(marked as a failed event)

+

Both Neopixel and Simple GPIO have a momentary state

+
+
+

Neopixel

+

Simple GPIO

+
+
-
-
-
-

Auth Success Color

-
-
-
- - +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+

Auth Success Color

+
+
+
+ + +
+
+ + +
+
+ + +
-
- - +
+ +
+
+

Auth Failure Color

-
- - +
+
+ + +
+
+ + +
+
+ + +
- -
+
+ +
+
-

Auth Failure Color

+
+ Auth Success +
+ + +
+
+ + +
+
+ + +
+
-
-
- - -
-
- - -
-
- - -
+
+
+ Auth Failure +
+ + +
+
+ + +
+
+ + +
+
- -