From 8a83d352d7facafe08abbe4be05e7931b688c943 Mon Sep 17 00:00:00 2001 From: fmuntean Date: Sat, 23 Jul 2022 16:24:40 -0400 Subject: [PATCH] [Fix] Notification Page to display GPIO --- src/src/WebServer/NotificationPage.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/src/WebServer/NotificationPage.cpp b/src/src/WebServer/NotificationPage.cpp index 4e70930e0..9cb0c2c5d 100644 --- a/src/src/WebServer/NotificationPage.cpp +++ b/src/src/WebServer/NotificationPage.cpp @@ -65,8 +65,8 @@ void handle_notifications() { NPlugin_ptr[NotificationProtocolIndex](NPlugin::Function::NPLUGIN_WEBFORM_SAVE, 0, dummyString); } NotificationSettings.Port = getFormItemInt(F("port"), 0); - NotificationSettings.Pin1 = getFormItemInt(F("pin1"), 0); - NotificationSettings.Pin2 = getFormItemInt(F("pin2"), 0); + NotificationSettings.Pin1 = getFormItemInt(F("pin1"), -1); + NotificationSettings.Pin2 = getFormItemInt(F("pin2"), -1); Settings.NotificationEnabled[notificationindex] = isFormItemChecked(F("notificationenabled")); strncpy_webserver_arg(NotificationSettings.Domain, F("domain")); strncpy_webserver_arg(NotificationSettings.Server, F("server")); @@ -140,10 +140,9 @@ void handle_notifications() { html_TD(); addHtml(NotificationSettings.Server); html_TD(); - addHtmlInt(NotificationSettings.Port); - } - else - { + if (NotificationSettings.Port){ + addHtmlInt(NotificationSettings.Port); + } else { //MFD: we display the GPIO addGpioHtml(NotificationSettings.Pin1); @@ -152,6 +151,9 @@ void handle_notifications() { html_BR(); addGpioHtml(NotificationSettings.Pin2); } + } + } + else{ html_TD(3); } }