Merge pull request #4157 from fmuntean/NOTIFICATION_PAGE_PIN

[Fix] Notification Page to display GPIO
This commit is contained in:
TD-er
2022-07-23 22:33:25 +02:00
committed by GitHub
+8 -6
View File
@@ -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);
}
}