A switch has a unitary plastic body that can be formed by injection moulding
or
extrusion. The body has a base that holds a magnetic field sensor. The base is
fastened to a support structure by a plurality of fasteners. The base is connected
to an arm by an elastic U-shaped portion of the plastic body that acts as both
a hinge and a biasing member. The arm positions an activation magnet over the base
and the sensor. The arm does not block access to fasteners that mount the switch
to the support structure.