From 3fbd571df701415bc058ef16546581dfbc9d388b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 22 Apr 2026 06:12:22 +0200 Subject: [PATCH] [core] Compute get_config_version_hash at compile time --- esphome/core/application.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index b626eb1de6..810c4f7794 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -702,7 +702,10 @@ void Application::get_comment_string(std::span b 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); } +uint32_t Application::get_config_version_hash() { + constexpr uint32_t HASH = fnv1a_hash_extend(ESPHOME_CONFIG_HASH, ESPHOME_VERSION); + return HASH; +} time_t Application::get_build_time() { return ESPHOME_BUILD_TIME; }