1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-08 06:12:20 +01:00

Allow disabling OTA for web_server while keeping it enabled for captive_portal (#9583)

This commit is contained in:
J. Nick Koston
2025-07-16 17:05:09 -10:00
committed by GitHub
parent 02999195cd
commit b1655b3fd4
5 changed files with 46 additions and 20 deletions

View File

@@ -268,10 +268,10 @@ std::string WebServer::get_config_json() {
return json::build_json([this](JsonObject root) {
root["title"] = App.get_friendly_name().empty() ? App.get_name() : App.get_friendly_name();
root["comment"] = App.get_comment();
#ifdef USE_WEBSERVER_OTA
root["ota"] = true; // web_server OTA platform is configured
#if defined(USE_WEBSERVER_OTA_DISABLED) || !defined(USE_WEBSERVER_OTA)
root["ota"] = false; // Note: USE_WEBSERVER_OTA_DISABLED only affects web_server, not captive_portal
#else
root["ota"] = false;
root["ota"] = true;
#endif
root["log"] = this->expose_log_;
root["lang"] = "en";