……..Unless the special device allows it……..
NEXT…..your switch connecting the black and the white wires is a direct short…….disconnect them !
The White wires are connected together with a wire nut…….
The Grounds are connected together….to the METAL box if used and pigtailed to the switch’s green screw…………
the black wires EACH connect to a Screw on the switch ……….
The Black wire is always switched…..Here’s a LINK