From bea70b6cd23286492d538498d18bd193cb77f598 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 1/8] [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> --- .../version/version_text_sensor.cpp | 4 ++- esphome/components/web_server/web_server.cpp | 5 ++-- esphome/core/application.cpp | 25 ++++++++++++++++ esphome/core/application.h | 30 +++++++------------ 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/esphome/components/version/version_text_sensor.cpp b/esphome/components/version/version_text_sensor.cpp index 2e5686008b..bac0e44f75 100644 --- a/esphome/components/version/version_text_sensor.cpp +++ b/esphome/components/version/version_text_sensor.cpp @@ -25,7 +25,9 @@ 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); - ESPHOME_strncat_P(version_str, ESPHOME_BUILD_TIME_STR, sizeof(version_str) - strlen(version_str) - 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); } strncat(version_str, ")", sizeof(version_str) - strlen(version_str) - 1); diff --git a/esphome/components/web_server/web_server.cpp b/esphome/components/web_server/web_server.cpp index 4b572417c1..a4ca0d9109 100644 --- a/esphome/components/web_server/web_server.cpp +++ b/esphome/components/web_server/web_server.cpp @@ -375,9 +375,8 @@ 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(); - char comment_buffer[ESPHOME_COMMENT_SIZE]; - App.get_comment_string(comment_buffer); - root[ESPHOME_F("comment")] = comment_buffer; + auto comment = App.get_comment(); + root[ESPHOME_F("comment")] = comment.c_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 diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index c6597897dc..4d0a582f14 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -749,4 +749,29 @@ void Application::get_build_time_string(std::span buf buffer[buffer.size() - 1] = '\0'; } +size_t Application::get_comment_size() { return ESPHOME_COMMENT_SIZE; } + +void Application::get_comment_string(char *buffer, size_t size) { + ESPHOME_strncpy_P(buffer, ESPHOME_COMMENT_STR, size); + buffer[size - 1] = '\0'; +} + +std::string Application::get_comment() { + char buffer[ESPHOME_COMMENT_SIZE]; + this->get_comment_string(buffer, sizeof(buffer)); + return std::string(buffer); +} + +uint32_t Application::get_config_hash() { return ESPHOME_CONFIG_HASH; } + +uint32_t Application::get_config_version_hash() { return fnv1a_hash_extend(ESPHOME_CONFIG_HASH, ESPHOME_VERSION); } + +time_t Application::get_build_time() { return ESPHOME_BUILD_TIME; } + +std::string Application::get_compilation_time() { + char buf[BUILD_TIME_STR_SIZE]; + this->get_build_time_string(buf); + return std::string(buf); +} + } // namespace esphome diff --git a/esphome/core/application.h b/esphome/core/application.h index 5b3e3dfed6..625c0a3304 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -6,7 +6,6 @@ #include #include #include -#include "esphome/core/build_info_data.h" #include "esphome/core/component.h" #include "esphome/core/defines.h" #include "esphome/core/hal.h" @@ -274,19 +273,14 @@ class Application { return ""; } + /// Get the size of the comment buffer (including null terminator) + static size_t get_comment_size(); + /// Copy the comment string into the provided buffer - /// Buffer must be ESPHOME_COMMENT_SIZE bytes (compile-time enforced) - void get_comment_string(std::span buffer) { - ESPHOME_strncpy_P(buffer.data(), ESPHOME_COMMENT_STR, buffer.size()); - buffer[buffer.size() - 1] = '\0'; - } + void get_comment_string(char *buffer, size_t size); /// Get the comment of this Application as a string - std::string get_comment() { - char buffer[ESPHOME_COMMENT_SIZE]; - this->get_comment_string(buffer); - return std::string(buffer); - } + std::string get_comment(); bool is_name_add_mac_suffix_enabled() const { return this->name_add_mac_suffix_; } @@ -294,26 +288,22 @@ class Application { static constexpr size_t BUILD_TIME_STR_SIZE = 26; /// Get the config hash as a 32-bit integer - constexpr uint32_t get_config_hash() { return ESPHOME_CONFIG_HASH; } + uint32_t get_config_hash(); /// Get the config hash extended with ESPHome version - constexpr uint32_t get_config_version_hash() { return fnv1a_hash_extend(ESPHOME_CONFIG_HASH, ESPHOME_VERSION); } + uint32_t get_config_version_hash(); /// Get the build time as a Unix timestamp - constexpr time_t get_build_time() { return ESPHOME_BUILD_TIME; } + time_t get_build_time(); /// Copy the build time string into the provided buffer - /// Buffer must be BUILD_TIME_STR_SIZE bytes (compile-time enforced) + /// Buffer must be BUILD_TIME_STR_SIZE bytes void get_build_time_string(std::span buffer); /// Get the build time as a string (deprecated, use get_build_time_string() instead) // Remove before 2026.7.0 ESPDEPRECATED("Use get_build_time_string() instead. Removed in 2026.7.0", "2026.1.0") - std::string get_compilation_time() { - char buf[BUILD_TIME_STR_SIZE]; - this->get_build_time_string(buf); - return std::string(buf); - } + std::string get_compilation_time(); /// Get the cached time in milliseconds from when the current component started its loop execution inline uint32_t IRAM_ATTR HOT get_loop_component_start_time() const { return this->loop_component_start_time_; } From 8780ec29d950b7a3cb12c9456dac32143c028902 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 2/8] [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 | 1 + 1 file changed, 1 insertion(+) diff --git a/esphome/components/version/version_text_sensor.cpp b/esphome/components/version/version_text_sensor.cpp index bac0e44f75..351dff0a98 100644 --- a/esphome/components/version/version_text_sensor.cpp +++ b/esphome/components/version/version_text_sensor.cpp @@ -1,5 +1,6 @@ #include "version_text_sensor.h" #include "esphome/core/application.h" +#include "esphome/core/build_info_data.h" #include "esphome/core/log.h" #include "esphome/core/version.h" #include "esphome/core/helpers.h" 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 3/8] [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); 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 4/8] [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 a4ca0d9109..909625288b 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 From d324a6c9e68a1380ab9edacde70efebfcd032553 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 5/8] [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 | 5 +++-- esphome/core/application.cpp | 15 +++++++-------- esphome/core/application.h | 11 +++++------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/esphome/components/web_server/web_server.cpp b/esphome/components/web_server/web_server.cpp index 909625288b..fab701d5f1 100644 --- a/esphome/components/web_server/web_server.cpp +++ b/esphome/components/web_server/web_server.cpp @@ -4,7 +4,6 @@ #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" @@ -376,7 +375,9 @@ 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(); - root[ESPHOME_F("comment")] = ESPHOME_COMMENT_STR; + char comment_buffer[Application::COMMENT_MAX_SIZE]; + App.get_comment_string(comment_buffer); + root[ESPHOME_F("comment")] = comment_buffer; #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 diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 4d0a582f14..0bdfa2b586 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -215,7 +215,8 @@ void Application::loop() { void Application::process_dump_config_() { if (this->dump_config_at_ == 0) { char build_time_str[Application::BUILD_TIME_STR_SIZE]; - this->get_build_time_string(build_time_str); + ESPHOME_strncpy_P(build_time_str, ESPHOME_BUILD_TIME_STR, sizeof(build_time_str)); + build_time_str[sizeof(build_time_str) - 1] = '\0'; ESP_LOGI(TAG, "ESPHome version " ESPHOME_VERSION " compiled on %s", build_time_str); #ifdef ESPHOME_PROJECT_NAME ESP_LOGI(TAG, "Project " ESPHOME_PROJECT_NAME " version " ESPHOME_PROJECT_VERSION); @@ -749,16 +750,14 @@ void Application::get_build_time_string(std::span buf buffer[buffer.size() - 1] = '\0'; } -size_t Application::get_comment_size() { return ESPHOME_COMMENT_SIZE; } - -void Application::get_comment_string(char *buffer, size_t size) { - ESPHOME_strncpy_P(buffer, ESPHOME_COMMENT_STR, size); - buffer[size - 1] = '\0'; +void Application::get_comment_string(std::span buffer) { + ESPHOME_strncpy_P(buffer.data(), ESPHOME_COMMENT_STR, buffer.size()); + buffer[buffer.size() - 1] = '\0'; } std::string Application::get_comment() { - char buffer[ESPHOME_COMMENT_SIZE]; - this->get_comment_string(buffer, sizeof(buffer)); + char buffer[COMMENT_MAX_SIZE]; + this->get_comment_string(buffer); return std::string(buffer); } diff --git a/esphome/core/application.h b/esphome/core/application.h index 625c0a3304..56fa690cbe 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -273,11 +273,11 @@ class Application { return ""; } - /// Get the size of the comment buffer (including null terminator) - static size_t get_comment_size(); + /// Maximum size of the comment buffer (including null terminator) + static constexpr size_t COMMENT_MAX_SIZE = 256; - /// Copy the comment string into the provided buffer - void get_comment_string(char *buffer, size_t size); + /// Get the comment string (PROGMEM-safe, copies to buffer) + void get_comment_string(std::span buffer); /// Get the comment of this Application as a string std::string get_comment(); @@ -296,8 +296,7 @@ class Application { /// Get the build time as a Unix timestamp time_t get_build_time(); - /// Copy the build time string into the provided buffer - /// Buffer must be BUILD_TIME_STR_SIZE bytes + /// Get the build time string (PROGMEM-safe, copies to buffer) void get_build_time_string(std::span buffer); /// Get the build time as a string (deprecated, use get_build_time_string() instead) From 79e567a3f1f882fad802eaa47949a3dd4c416e40 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:30:02 -0500 Subject: [PATCH 6/8] Fix --- esphome/core/application.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/esphome/core/application.h b/esphome/core/application.h index 56fa690cbe..ee5ec559f4 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -276,11 +276,15 @@ class Application { /// Maximum size of the comment buffer (including null terminator) static constexpr size_t COMMENT_MAX_SIZE = 256; - /// Get the comment string (PROGMEM-safe, copies to buffer) + /// Copy the comment string into the provided buffer void get_comment_string(std::span buffer); /// Get the comment of this Application as a string - std::string get_comment(); + std::string get_comment() { + char buffer[COMMENT_MAX_SIZE]; + this->get_comment_string(buffer); + return std::string(buffer); + } bool is_name_add_mac_suffix_enabled() const { return this->name_add_mac_suffix_; } @@ -296,13 +300,18 @@ class Application { /// Get the build time as a Unix timestamp time_t get_build_time(); - /// Get the build time string (PROGMEM-safe, copies to buffer) + /// Copy the build time string into the provided buffer + /// Buffer must be BUILD_TIME_STR_SIZE bytes (compile-time enforced) void get_build_time_string(std::span buffer); /// Get the build time as a string (deprecated, use get_build_time_string() instead) // Remove before 2026.7.0 ESPDEPRECATED("Use get_build_time_string() instead. Removed in 2026.7.0", "2026.1.0") - std::string get_compilation_time(); + std::string get_compilation_time() { + char buf[BUILD_TIME_STR_SIZE]; + this->get_build_time_string(buf); + return std::string(buf); + } /// Get the cached time in milliseconds from when the current component started its loop execution inline uint32_t IRAM_ATTR HOT get_loop_component_start_time() const { return this->loop_component_start_time_; } From f21c69850c2d03fde8f1ab58122e8cf9ce9e7aa1 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:31:40 -0500 Subject: [PATCH 7/8] Fix --- .../esp32_hosted/update/esp32_hosted_update.cpp | 2 +- esphome/components/web_server/web_server.cpp | 2 +- esphome/core/application.cpp | 17 ++--------------- esphome/core/application.h | 6 +++--- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp b/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp index dcd6e643c2..abc5f29182 100644 --- a/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp +++ b/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp @@ -152,7 +152,7 @@ void Esp32HostedUpdate::setup() { void Esp32HostedUpdate::dump_config() { ESP_LOGCONFIG(TAG, - "ESP32 Hosted Update:\n" + "ESP32 Hostedd Update:\n" " Host Library Version: %s\n" " Coprocessor Version: %s\n" " Latest Version: %s", diff --git a/esphome/components/web_server/web_server.cpp b/esphome/components/web_server/web_server.cpp index fab701d5f1..682008c40e 100644 --- a/esphome/components/web_server/web_server.cpp +++ b/esphome/components/web_server/web_server.cpp @@ -375,7 +375,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(); - char comment_buffer[Application::COMMENT_MAX_SIZE]; + char comment_buffer[Application::ESPHOME_COMMENT_SIZE_MAX]; App.get_comment_string(comment_buffer); root[ESPHOME_F("comment")] = comment_buffer; #if defined(USE_WEBSERVER_OTA_DISABLED) || !defined(USE_WEBSERVER_OTA) diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 0bdfa2b586..4ed0224b19 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -215,8 +215,7 @@ void Application::loop() { void Application::process_dump_config_() { if (this->dump_config_at_ == 0) { char build_time_str[Application::BUILD_TIME_STR_SIZE]; - ESPHOME_strncpy_P(build_time_str, ESPHOME_BUILD_TIME_STR, sizeof(build_time_str)); - build_time_str[sizeof(build_time_str) - 1] = '\0'; + this->get_build_time_string(build_time_str); ESP_LOGI(TAG, "ESPHome version " ESPHOME_VERSION " compiled on %s", build_time_str); #ifdef ESPHOME_PROJECT_NAME ESP_LOGI(TAG, "Project " ESPHOME_PROJECT_NAME " version " ESPHOME_PROJECT_VERSION); @@ -750,27 +749,15 @@ void Application::get_build_time_string(std::span buf buffer[buffer.size() - 1] = '\0'; } -void Application::get_comment_string(std::span buffer) { +void Application::get_comment_string(std::span buffer) { ESPHOME_strncpy_P(buffer.data(), ESPHOME_COMMENT_STR, buffer.size()); buffer[buffer.size() - 1] = '\0'; } -std::string Application::get_comment() { - char buffer[COMMENT_MAX_SIZE]; - this->get_comment_string(buffer); - return std::string(buffer); -} - uint32_t Application::get_config_hash() { return ESPHOME_CONFIG_HASH; } uint32_t Application::get_config_version_hash() { return fnv1a_hash_extend(ESPHOME_CONFIG_HASH, ESPHOME_VERSION); } time_t Application::get_build_time() { return ESPHOME_BUILD_TIME; } -std::string Application::get_compilation_time() { - char buf[BUILD_TIME_STR_SIZE]; - this->get_build_time_string(buf); - return std::string(buf); -} - } // namespace esphome diff --git a/esphome/core/application.h b/esphome/core/application.h index ee5ec559f4..cd275bb97f 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -274,14 +274,14 @@ class Application { } /// Maximum size of the comment buffer (including null terminator) - static constexpr size_t COMMENT_MAX_SIZE = 256; + static constexpr size_t ESPHOME_COMMENT_SIZE_MAX = 256; /// Copy the comment string into the provided buffer - void get_comment_string(std::span buffer); + void get_comment_string(std::span buffer); /// Get the comment of this Application as a string std::string get_comment() { - char buffer[COMMENT_MAX_SIZE]; + char buffer[ESPHOME_COMMENT_SIZE_MAX]; this->get_comment_string(buffer); return std::string(buffer); } From e3aa732244cc5c1fc5ebe6b70a5941d17d59d063 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:10:39 -0500 Subject: [PATCH 8/8] Fix --- .../components/esp32_hosted/update/esp32_hosted_update.cpp | 2 +- esphome/core/application.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp b/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp index abc5f29182..dcd6e643c2 100644 --- a/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp +++ b/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp @@ -152,7 +152,7 @@ void Esp32HostedUpdate::setup() { void Esp32HostedUpdate::dump_config() { ESP_LOGCONFIG(TAG, - "ESP32 Hostedd Update:\n" + "ESP32 Hosted Update:\n" " Host Library Version: %s\n" " Coprocessor Version: %s\n" " Latest Version: %s", diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 4ed0224b19..1cb7dc0075 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -750,8 +750,8 @@ void Application::get_build_time_string(std::span buf } void Application::get_comment_string(std::span buffer) { - ESPHOME_strncpy_P(buffer.data(), ESPHOME_COMMENT_STR, buffer.size()); - buffer[buffer.size() - 1] = '\0'; + ESPHOME_strncpy_P(buffer.data(), ESPHOME_COMMENT_STR, ESPHOME_COMMENT_SIZE); + buffer[ESPHOME_COMMENT_SIZE - 1] = '\0'; } uint32_t Application::get_config_hash() { return ESPHOME_CONFIG_HASH; }