From 111340bda449a9f0c9eeb2caf4903ccbec22f721 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/version/version_text_sensor.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/esphome/components/version/version_text_sensor.cpp b/esphome/components/version/version_text_sensor.cpp index 351dff0a98..74bb4c76e8 100644 --- a/esphome/components/version/version_text_sensor.cpp +++ b/esphome/components/version/version_text_sensor.cpp @@ -26,9 +26,7 @@ void VersionTextSensor::setup() { if (!this->hide_timestamp_) { size_t len = strlen(version_str); ESPHOME_strncat_P(version_str, BUILT_STR, sizeof(version_str) - len - 1); - char time_buf[esphome::Application::BUILD_TIME_STR_SIZE]; - App.get_build_time_string(time_buf); - strncat(version_str, time_buf, sizeof(version_str) - strlen(version_str) - 1); + ESPHOME_strncat_P(version_str, ESPHOME_BUILD_TIME_STR, sizeof(version_str) - strlen(version_str) - 1); } strncat(version_str, ")", sizeof(version_str) - strlen(version_str) - 1);