Raspberry pi gpio keypad

i want to connect 3x4 matrix keypad to raspberry pi with home assistant core to control via password simple electric door lock connected to rapsperry via relay.
i spend too much time on that trying to do it with node red and python plugin. it almost worked. i wanted to start checking pass by pressing “*” and after “#” open the door but after execution of python code i’m loosing integration between home assistant and key pad (every column is set to hight)
It caused by this GPIO.setup(C1, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
is there any smart solution this?