I took up the sysfs-based approach in my own (golang-based) project: https://github.com/mhemeryck/unipitt
Basically, it does active polling on a series of files, representing the different inputs and pushes out an MQTT-event in case there's a change.