Turn the sensor off when closing (if connected).