mirror of
https://github.com/esphome/esphome.git
synced 2026-09-02 11:06:04 +00:00
0b2f79480be3f703b84ea616425987c6bdab93eb
Replace std::string with StringRef (non-owning string view) for user service string arguments in YAML-generated services. This avoids unnecessary heap allocation when the protobuf decode buffer already contains the string data. Key changes: - Frame helpers reserve +1 byte in rx_buf_ so string fields can be safely null-terminated in-place after decode - Add (null_terminate) protobuf field option to target only fields that need it (ExecuteServiceArgument.string_ and HomeAssistantStateResponse.state) - Add StringRef template specializations for get_execute_arg_value and to_service_arg_type - Python codegen uses StringRef for string service args, with automatic std::string fallback when deferred actions (delay, wait_until, script.wait) are present in the action chain - Add deferred flag to action registry for detecting actions that store trigger args for later execution - Simplify HomeAssistantStateResponse handler by removing SmallBufferWithHeapFallback copy (state is null-terminated in-place) - Add compare() method to StringRef for external component compatibility Saves ~240 bytes of flash on ESP8266 by eliminating std::string template instantiations for user service string arguments.
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
605 MiB
Languages
C++
56.1%
Python
43.3%
C
0.3%
JavaScript
0.2%
