for detecting open or closed state or particular intermediate positions assumed by movable parts of the enclosure