[api] Avoid heap allocation in PSK update timeout lambda (#14921)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2026-03-23 13:41:09 -10:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent 382de7ca90
commit 13d3968d9b
2 changed files with 22 additions and 10 deletions
+3 -1
View File
@@ -239,7 +239,9 @@ class APIServer final : public Component,
#ifdef USE_API_NOISE
bool update_noise_psk_(const SavedNoisePsk &new_psk, const LogString *save_log_msg, const LogString *fail_log_msg,
const psk_t &active_psk, bool make_active);
bool make_active);
// Load saved PSK from preferences and apply it. Returns true on success.
bool load_and_apply_noise_psk_();
#endif // USE_API_NOISE
#ifdef USE_API_HOMEASSISTANT_STATES
// Helper methods to reduce code duplication