[core] Use StringRef for get_comment and get_compilation_time to avoid allocations (#12219)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-12-08 16:36:13 +01:00
committed by GitHub
parent 7e486b1c25
commit d635892ecf
9 changed files with 20 additions and 7 deletions

View File

@@ -287,7 +287,7 @@ std::string WebServer::get_config_json() {
JsonObject root = builder.root();
root[ESPHOME_F("title")] = App.get_friendly_name().empty() ? App.get_name() : App.get_friendly_name();
root[ESPHOME_F("comment")] = App.get_comment();
root[ESPHOME_F("comment")] = App.get_comment_ref();
#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