mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 01:58:39 +00:00
3187ab920859a634e1a3adea1f21fbe8f2d871f7
The set_timeout lambda captured a psk_t (std::array<uint8_t, 32>) by value, making the lambda 36 bytes — well beyond the std::function small buffer optimization threshold, forcing a heap allocation. Re-read the PSK from preferences inside the timeout callback instead. The PSK was just saved to flash moments before the timeout was scheduled, so re-reading it is reliable and avoids the large capture. Extract load_and_apply_noise_psk_() helper to deduplicate the load-from-preferences-and-apply pattern used in both setup() and the timeout callback.
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
596 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
