05-18-2020, 04:23 PM
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:
and
Do I need to change anything here when upgrading?
The last bit of code, that I'm unsure about is this:
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 ?
First up is checking if Airplay is on:
Code:
# Airplay state check
def IsAirplayOn():
global ButtonOverride
AirplayOn = False
try:
cur = con.cursor()
cur.execute('select value from cfg_system where param=\'airplayactv\'')
data = cur.fetchone()[0]
if (Debug): print "SQL = %s" % data
if data == "1":
AirplayOn = True
except SQLite3.Error, e:
if (Debug): print "Error %s:" % e.args[0]
if ButtonOverride:
AirplayOn = False
if Debug: print "Returning IsAirplayOn = {0}".format(AirplayOn)
return AirplayOn
and
Code:
# Connect to player database, in order to read Airplay status
try:
con = SQLite3.connect('/var/local/www/db/moode-sqlite3.db')
except SQLite3.Error, e:
if Debug: print "Error %s:" % e.args[0]
sys.exit(1)
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
Client = mpd.MPDClient() # create client object
Client.timeout = None
Client.idletimeout = None
while True:
try:
Client.connect("localhost", 6600) # connect to localhost:6600
except:
continue
break
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 ?
Max Schmeling