Connecting to database with python - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: Connecting to database with python (/showthread.php?tid=2546) |
Connecting to database with python - Max Schmeling - 05-18-2020 I'm on Moode 4.1+Rpi2b and I have just upgraded to Moode 6.5.2 + Rpi4 I run a python script that helps me with power and a button and the script has a few places, where I'm unsure if I need to change anything. First up is checking if Airplay is on: Code: # Airplay state check and Code: # Connect to player database, in order to read Airplay status Do I need to change anything here when upgrading? The last bit of code, that I'm unsure about is this: Code: # Setup MDPClient and connect to MPD on localhost Does anyone know if I need to change anything in these three code bits in order to get it woring under moode 6.5.2 ? RE: Connecting to database with python - TheOldPresbyope - 05-18-2020 @Max Schmeling What, no "try it and see" test The airplayactv parameter hasn't changed in 6.5.2. I think your code will work unmodified. However, you ought to consider updating it to Python3. At some point the Debian maintainers will remove the Python 2 stack and I expect the Raspbian maintainers will too. Regards, Kent RE: Connecting to database with python - Max Schmeling - 05-19-2020 (05-18-2020, 04:55 PM)TheOldPresbyope Wrote: @Max Schmeling @TheOldPresbyope Thanks. I just tried updating to P3 and installing python-mpd2. Everything seems to work, but I'll have to check, once I get it in the box with the buttons. I'll report back RE: Connecting to database with python - Max Schmeling - 05-20-2020 (05-19-2020, 11:06 AM)Max Schmeling Wrote:(05-18-2020, 04:55 PM)TheOldPresbyope Wrote: @Max Schmeling Right . Guess I have to install the python-mdp2 with pip3 and not pip. Now it is working |