[core] Add LOG_ENTITY_ICON/DEVICE_CLASS/UNIT_OF_MEASUREMENT macros (#13578)

This commit is contained in:
J. Nick Koston
2026-01-27 19:11:30 -10:00
committed by GitHub
parent ded835ab63
commit b4f63fd992
17 changed files with 49 additions and 71 deletions

View File

@@ -22,13 +22,8 @@ void log_sensor(const char *tag, const char *prefix, const char *type, Sensor *o
LOG_STR_ARG(state_class_to_string(obj->get_state_class())), prefix,
obj->get_unit_of_measurement_ref().c_str(), prefix, obj->get_accuracy_decimals());
if (!obj->get_device_class_ref().empty()) {
ESP_LOGCONFIG(tag, "%s Device Class: '%s'", prefix, obj->get_device_class_ref().c_str());
}
if (!obj->get_icon_ref().empty()) {
ESP_LOGCONFIG(tag, "%s Icon: '%s'", prefix, obj->get_icon_ref().c_str());
}
LOG_ENTITY_DEVICE_CLASS(tag, prefix, *obj);
LOG_ENTITY_ICON(tag, prefix, *obj);
if (obj->get_force_update()) {
ESP_LOGV(tag, "%s Force Update: YES", prefix);