mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 00:31:58 +00:00
[homeassistant] Use buf_append_printf for ESP8266 flash optimization (#13284)
This commit is contained in:
@@ -97,7 +97,7 @@ void HomeassistantNumber::control(float value) {
|
||||
entity_value.key = VALUE_KEY;
|
||||
// Stack buffer - no heap allocation; %g produces shortest representation
|
||||
char value_buf[16];
|
||||
snprintf(value_buf, sizeof(value_buf), "%g", value);
|
||||
buf_append_printf(value_buf, sizeof(value_buf), 0, "%g", value);
|
||||
entity_value.value = StringRef(value_buf);
|
||||
|
||||
api::global_api_server->send_homeassistant_action(resp);
|
||||
|
||||
Reference in New Issue
Block a user