def __init__(self, gpio_pin): self.gpio_pin = gpio_pin GPIO.setmode(GPIO.BCM) GPIO.setup(gpio_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)