Thank you for your donation!


Rotary Encoder: What are the possibilities?
#11
@Tim Curtis I solved it, the pins I used are I2C pins which caused the problems.

Just two followup questions:

- How can I determine (python) if the squeezeplayer is running or moode itself? (To change either the local volume or squeeze volume)
- How can I start a particular station (favourites) in the moode player programmatically?

Thank you very much!
Reply
#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
Reply
#13
That's great, thanks!
Reply


Forum Jump: