Only disable Arduino OTA when using -D WLED_DISABLE_OTA

- since Update object is accessible even with ArduinoOTA disabled it should possible to use HTTP OTA regardless
- this saves about 12kB while still allowing OTA updates
- HTTP OTA updates can be blocked using PIN or OTA lock
This commit is contained in:
Blaž Kristan 2025-04-20 11:01:19 +02:00
parent 02f14baad4
commit ca7d7d9369

View File

@ -365,7 +365,6 @@ void initServer()
createEditHandler(correctPIN);
static const char _update[] PROGMEM = "/update";
#ifndef WLED_DISABLE_OTA
//init ota page
server.on(_update, HTTP_GET, [](AsyncWebServerRequest *request){
if (otaLock) {
@ -419,12 +418,6 @@ void initServer()
}
}
});
#else
server.on(_update, HTTP_GET, [](AsyncWebServerRequest *request){
serveMessage(request, 501, FPSTR(s_notimplemented), F("OTA updating is disabled in this build."), 254);
});
#endif
#ifdef WLED_ENABLE_DMX
server.on(F("/dmxmap"), HTTP_GET, [](AsyncWebServerRequest *request){