This is a case for the Sonoff Basic Wifi switch. It's designed to fit tight enough (like a Speedo) to allow installation in a wall light socket. It's definitely safer than just wrapping it in electrical tape!
There are two versions available, a thin and a normal one, but we only use the normal version. The normal version is designed to be rigid and thick enough to protect the PCB during installation.
The thin version only works with a flexible material as it actually wraps around the PCB and holds tight. I printed it in TPU and it works, but in the end I decided I wanted the protection of Sonoff to save a few millimetres with the very tight design.