1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-01 09:32:21 +01:00

[core] Use get_icon_ref() in entity platform logging to avoid string allocations

This commit is contained in:
J. Nick Koston
2025-09-01 23:01:11 -05:00
parent ed48282d09
commit ae46100af8
12 changed files with 24 additions and 24 deletions

View File

@@ -14,8 +14,8 @@ void log_number(const char *tag, const char *prefix, const char *type, Number *o
ESP_LOGCONFIG(tag, "%s%s '%s'", prefix, type, obj->get_name().c_str());
if (!obj->get_icon().empty()) {
ESP_LOGCONFIG(tag, "%s Icon: '%s'", prefix, obj->get_icon().c_str());
if (!obj->get_icon_ref().empty()) {
ESP_LOGCONFIG(tag, "%s Icon: '%s'", prefix, obj->get_icon_ref().c_str());
}
if (!obj->traits.get_unit_of_measurement().empty()) {