Merge branch 'fix-incremental-rebuild' into integration

# Conflicts:
#	esphome/core/application.cpp
This commit is contained in:
J. Nick Koston
2026-02-23 16:03:41 -06:00
4 changed files with 21 additions and 11 deletions
@@ -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"
+1 -1
View File
@@ -376,7 +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();
char comment_buffer[ESPHOME_COMMENT_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)
+11
View File
@@ -774,6 +774,17 @@ void Application::get_build_time_string(std::span<char, BUILD_TIME_STR_SIZE> buf
buffer[buffer.size() - 1] = '\0';
}
void Application::get_comment_string(std::span<char, ESPHOME_COMMENT_SIZE_MAX> buffer) {
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; }
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; }
#ifdef USE_SETUP_HEAP_STATS
void Application::init_setup_heap_stats_baseline_() {
this->setup_heap_stats_baseline_ = setup_heap_stats::SetupHeapStatsCollector::get_free_internal_heap();
+8 -10
View File
@@ -6,7 +6,6 @@
#include <span>
#include <string>
#include <vector>
#include "esphome/core/build_info_data.h"
#include "esphome/core/component.h"
#include "esphome/core/defines.h"
#include "esphome/core/hal.h"
@@ -391,16 +390,15 @@ class Application {
return "";
}
/// Maximum size of the comment buffer (including null terminator)
static constexpr size_t ESPHOME_COMMENT_SIZE_MAX = 256;
/// Copy the comment string into the provided buffer
/// Buffer must be ESPHOME_COMMENT_SIZE bytes (compile-time enforced)
void get_comment_string(std::span<char, ESPHOME_COMMENT_SIZE> buffer) {
ESPHOME_strncpy_P(buffer.data(), ESPHOME_COMMENT_STR, buffer.size());
buffer[buffer.size() - 1] = '\0';
}
void get_comment_string(std::span<char, ESPHOME_COMMENT_SIZE_MAX> buffer);
/// Get the comment of this Application as a string
std::string get_comment() {
char buffer[ESPHOME_COMMENT_SIZE];
char buffer[ESPHOME_COMMENT_SIZE_MAX];
this->get_comment_string(buffer);
return std::string(buffer);
}
@@ -411,13 +409,13 @@ 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)