I am currently building a childproof musicbox for my little son. It is supposed to play given playlists by RFID input (emulated keyboard; the USB-RFID reader returns HEX-code and presses ENTER). I would like to integrate this functionality by running a Python script next to volumio, communicating via the websocket API. The python script prompts for an input from the connected RFID-reader and then hands the playlist name (corresponding to the HEX-code from an RFID-card) to volumio via the API using socketIO and the playPlaylist command.
I began writing some code and was wondering if something like the following could work:
while True :
inp = input("Waiting for card...")
I am but a simple hobby programmer and quite new to APIs. Feel free to point out my potentially stupid mistakes. I shall be thankful!