The lamp has switch to turn it on/off and encoder with button for interacting with its menus.
How it was made.
Just a plastic box, foam board plate, lamp holder, relay module, wire with switch, screws/nuts, some hot glue and electronic modules.
The following diagram represents the state machine used in device's program.
Check out github repo for sources.