mirror of
https://github.com/esphome/esphome.git
synced 2026-02-27 17:34:22 -07:00
91487e7f14ddfe4c0316c292aa580654e3536228
On ESP8266, .rodata is copied to RAM at boot. Every string literal in HomeAssistantServiceCallAction (service names, data keys, data values) permanently consumes RAM even though the action may rarely fire. Add FLASH_STRING type to TemplatableValue that stores PROGMEM pointers on ESP8266 via the existing __FlashStringHelper* type. At play() time, strings are copied from flash to temporary std::string storage — safe because service calls are not in the hot path. Add FlashStringLiteral codegen helper (cg.FlashStringLiteral) that wraps strings in ESPHOME_F() — expands to F() on ESP8266 (PROGMEM), plain string on other platforms (no-op). This helper can be adopted by other components incrementally. On non-ESP8266 platforms, FLASH_STRING is never set and all existing code paths are unchanged.
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
509 MiB
Languages
C++
64.1%
Python
35.5%
C
0.3%
