#!/usr/bin/python3
-import time, socket
+import time, socket, atexit
import RPi.GPIO as GPIO
tuerSock = "/run/tuer.sock"
GPIO.setmode(GPIO.BOARD)
GPIO.setup(ringPin, GPIO.IN)
+atexit.register(GPIO.cleanup);
lastEvent = 0
if data != b'1':
print("Received unexpected answer %s" % str(data))
-GPIO.cleanup()
+