Is that an important question? Presumably that person is running their automation enough that they get more than minimum wage.
You are allowed to pay by the peice, but you must pay at least minimum wage, you must pay sick leave, you must pay health insurance, you cannot fire for unjust cause (at least in Europe). That marks the definitive end to piece work as we knew it in Adam Smith's time when a stranger could show up at the factory door and be paid by the piece for one day or one afternoon, something which really was even common in the era before the "Fair Labor Standards Act" was passed [1]. To quote from your linked article on the Act "All individually covered homework is subject to the FLSA's minimum wage, overtime, and recordkeeping requirements. Employers must provide workers with handbooks to record time, expenses, and pay information."
Sounds to me like saying "Piecework is illegal" is oversimplified to the point of being false, if not highly misleading.