Does the board charge the battery if the Pi is connected to an external power supply?
I sourced the below script to monitor a GPIO in for high signal, but currently do not have a LiPo charger to charge my battery to test, would it work ?
import RPi.GPIO as GPIO
GPIO.setup(gpio_pin_number, GPIO.IN, pull_up_down=GPIO.PUD_UP)
os.system("sudo shutdown -h now")