From a0b687354ffff13514a9e9f51bf423767fe61b3c Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 23 Feb 2026 13:43:10 -0500 Subject: [PATCH] [core] Move build_info_data.h out of application.h to fix incremental rebuilds build_info_data.h contains ESPHOME_BUILD_TIME which changes every build. Since application.h included it, changing any source file caused build_info_data.h to be rewritten (via sources_changed), which then triggered a rebuild of every file that includes application.h. Move all build_info_data.h dependent code from application.h inline methods to application.cpp, so only application.cpp recompiles when build info changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- esphome/components/web_server/web_server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/web_server/web_server.cpp b/esphome/components/web_server/web_server.cpp index a4ca0d9109c..909625288bd 100644 --- a/esphome/components/web_server/web_server.cpp +++ b/esphome/components/web_server/web_server.cpp @@ -4,6 +4,7 @@ #include "esphome/core/progmem.h" #include "esphome/components/network/util.h" #include "esphome/core/application.h" +#include "esphome/core/build_info_data.h" #include "esphome/core/defines.h" #include "esphome/core/controller_registry.h" #include "esphome/core/entity_base.h" @@ -375,8 +376,7 @@ json::SerializationBuffer<> WebServer::get_config_json() { JsonObject root = builder.root(); root[ESPHOME_F("title")] = App.get_friendly_name().empty() ? App.get_name().c_str() : App.get_friendly_name().c_str(); - auto comment = App.get_comment(); - root[ESPHOME_F("comment")] = comment.c_str(); + root[ESPHOME_F("comment")] = ESPHOME_COMMENT_STR; #if defined(USE_WEBSERVER_OTA_DISABLED) || !defined(USE_WEBSERVER_OTA) root[ESPHOME_F("ota")] = false; // Note: USE_WEBSERVER_OTA_DISABLED only affects web_server, not captive_portal #else