Magnetic switch by the door