Update webserver.ino

This commit is contained in:
Adrian Scillato 2018-04-07 01:02:36 -03:00 committed by GitHub
parent 2983334728
commit 663994148a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,10 +25,10 @@
* Based on source by AlexT (https://github.com/tzapu) * Based on source by AlexT (https://github.com/tzapu)
\*********************************************************************************************/ \*********************************************************************************************/
#ifdef USE_KNX #ifdef USE_KNX
#include <esp-knx-ip.h> // Include KNX IP library #include <esp-knx-ip.h> // Include KNX IP library
#endif // USE_KNX #endif // USE_KNX
#define STR_HELPER(x) #x #define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x) #define STR(x) STR_HELPER(x)
@ -202,9 +202,9 @@ const char HTTP_BTN_MENU_MQTT[] PROGMEM =
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
""; "";
const char HTTP_BTN_MENU4[] PROGMEM = const char HTTP_BTN_MENU4[] PROGMEM =
#ifdef USE_KNX #ifdef USE_KNX
"<br/><form action='knx' method='get'><button>" D_CONFIGURE_KNX "</button></form>" "<br/><form action='knx' method='get'><button>" D_CONFIGURE_KNX "</button></form>"
#endif // USE_KNX #endif // USE_KNX
"<br/><form action='lg' method='get'><button>" D_CONFIGURE_LOGGING "</button></form>" "<br/><form action='lg' method='get'><button>" D_CONFIGURE_LOGGING "</button></form>"
"<br/><form action='co' method='get'><button>" D_CONFIGURE_OTHER "</button></form>" "<br/><form action='co' method='get'><button>" D_CONFIGURE_OTHER "</button></form>"
"<br/>" "<br/>"
@ -360,6 +360,9 @@ void StartWebserver(int type, IPAddress ipweb)
WebServer->on("/dm", HandleDomoticzConfiguration); WebServer->on("/dm", HandleDomoticzConfiguration);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ
} }
#ifdef USE_KNX
WebServer->on("/kn", HandleKNXConfiguration);
#endif // USE_KNX
WebServer->on("/lg", HandleLoggingConfiguration); WebServer->on("/lg", HandleLoggingConfiguration);
WebServer->on("/co", HandleOtherConfiguration); WebServer->on("/co", HandleOtherConfiguration);
WebServer->on("/dl", HandleBackupConfiguration); WebServer->on("/dl", HandleBackupConfiguration);
@ -389,9 +392,9 @@ void StartWebserver(int type, IPAddress ipweb)
} }
#endif // USE_EMULATION #endif // USE_EMULATION
WebServer->onNotFound(HandleNotFound); WebServer->onNotFound(HandleNotFound);
#ifdef USE_KNX #ifdef USE_KNX
knx.start(WebServer); // Start knx. The /knx link is automatically set inside the KNX library knx.start(WebServer); // Start knx. The /knx link is automatically set inside the KNX library
#endif // USE_KNX #endif // USE_KNX
} }
reset_web_log_flag = 0; reset_web_log_flag = 0;
WebServer->begin(); // Web server start WebServer->begin(); // Web server start