RaspberryPi code to read reed switches on a catflap