When setting up a lamp, if the lamp is already in the database (unique key by deviceId), then we should delete the old document before creating a new one. This will help when the user sets up their lamp again after something went wrong and it has gone back to setup mode.
When setting up a lamp, if the lamp is already in the database (unique key by deviceId), then we should delete the old document before creating a new one. This will help when the user sets up their lamp again after something went wrong and it has gone back to setup mode.