Deleting a device programmatically

What is the best way to delete a device programmatically? The plugin I’m maintaining uses
luup.chdev.start followed by
luup.chdev.append - all devices except the ones to be deleted - followed by
luup.chdev.sync
Is there another way?

The technique you have described is a standard pattern for child devices.

In general, a device may be deleted with an HTTP request, see:

http://wiki.micasaverde.com/index.php/Luup_Requests#device

But you should use this with caution as a plugin may easily recreate it on Luup reload.