Safety switches for hinged doors