mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
33e646cedf89f15b28135c6238a3a648d6df013d
Callback::create() can store callables inline (no heap allocation) when they fit in sizeof(void*) — i.e., a single [this] capture on 32-bit platforms. Many automation triggers captured [this, parent] in their callback lambdas, doubling the capture size and forcing heap allocation. Store the parent/state pointer as a class member and capture only [this] in the lambda. This trades 4 bytes of member storage for avoiding a permanent heap allocation per callback registration. Components changed: cover, valve, lock, fan, media_player, datetime, display_menu_base, graphical_display_menu, esp32_improv, mqtt_fan.
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
591 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
