![]() |
Detect if Bluetooth is active/playing using 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: Detect if Bluetooth is active/playing using python (/showthread.php?tid=3743) |
Detect if Bluetooth is active/playing using python - Max Schmeling - 04-26-2021 How can I, using python(3), check if the Bluetooth connection is active and, and if a device is connected? RE: Detect if Bluetooth is active/playing using python - Tim Curtis - 04-26-2021 The active flags are below. "1" = active. Code: pi@rp2:~ $ moodeutl -q "select * from cfg_system where param like '%active%'" To get the name of a connected Bluetooth device use the command below and parse the output. Code: # No device connected RE: Detect if Bluetooth is active/playing using python - Max Schmeling - 04-26-2021 Is it in any way possible to do this in Python? RE: Detect if Bluetooth is active/playing using python - TookaFace - 04-27-2021 For sqlite: https://docs.python.org/3/library/sqlite3.html For sudo /var/www/command/bt.sh -c, you can use subprocess: https://docs.python.org/fr/3/library/subprocess.html |