[web_server] Guard icon JSON field with USE_ENTITY_ICON (#13948)

This commit is contained in:
J. Nick Koston
2026-02-12 10:26:36 -06:00
committed by GitHub
parent 9aa98ed6c6
commit 725e774fe7

View File

@@ -557,7 +557,9 @@ static void set_json_id(JsonObject &root, EntityBase *obj, const char *prefix, J
root[ESPHOME_F("device")] = device_name;
}
#endif
#ifdef USE_ENTITY_ICON
root[ESPHOME_F("icon")] = obj->get_icon_ref();
#endif
root[ESPHOME_F("entity_category")] = obj->get_entity_category();
bool is_disabled = obj->is_disabled_by_default();
if (is_disabled)