Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Rotary Encoder: What are the possibilities?
#12
Nice :-)

Prolly something like below to determine whether squeezelite is active. The variable squeezelite_active will have the value '1' if squeezelite is active and '0' if it's not.

Code:
import time
import datetime
import sqlite3

db = sqlite3.connect('/var/local/www/db/moode-sqlite3.db')
db.row_factory = sqlite3.Row
db.text_factory = str
cursor = db.cursor()

cursor.execute("SELECT value FROM cfg_system WHERE param='slactive'")
row = cursor.fetchone()
squeezelite_active = row['value']
print str(datetime.datetime.now())[:19] + ' squeezelite_active = ' + squeezelite_active

To load and play individual radio stations or playlists its something like below

Code:
mpc clear
sudo mpc load "RADIO/Amys FM (320K).pls"
mpc play

-- or --

mpc clear
mpc load Favorites
mpc play
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
RE: Rotary Encoder: What are the possibilities? - by Tim Curtis - 03-31-2019, 09:28 PM

Forum Jump: