Python and Airfoil

Posted on
Thu Jul 07, 2022 8:45 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Python and Airfoil

As @FlyingDiver asks, please copy/paste all of the error lines from the Event Log into a reply.

Also, you say "when I set the Airfoil volumes from variables", what exactly do you mean (describe in detail please)? I suspect that you are using a script, and the script is the source of the error, not the Airfoil Plugin...

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Jul 08, 2022 4:35 am
Alain offline
Posts: 88
Joined: Apr 19, 2008

Re: Python and Airfoil

Here is the error message that shows up in the event log:

Script Error embedded script error:
Script Error multiple exception types must be parenthesized
Script Error around line 15 - "except Exception, e:"

This is the code that I am using that generates the error:

Kitchenvol = indigo.variables[1393229654] # Kitchen Speaker
Mezzvol = indigo.variables[306641482] # Mezzanine Speaker
Dockvol = indigo.variables[1379504043] # Dock Speaker
Deckvol = indigo.variables[1036974780] # Deck Speaker
Loungevol = indigo.variables[472300888] # Lounge Speaker

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.airfoilpro")
if airfoilPlugin.isEnabled():
try:
result = airfoilPlugin.executeAction('setVolume', deviceId=1273285365, props={'volume': Kitchenvol.value}, waitUntilDone=True)
result = airfoilPlugin.executeAction('setVolume', deviceId=835274311, props={'volume': Loungevol.value}, waitUntilDone=True)
result = airfoilPlugin.executeAction('setVolume', deviceId=243903985, props={'volume': Deckvol.value}, waitUntilDone=True)
result = airfoilPlugin.executeAction('setVolume', deviceId=1984618667, props={'volume': Mezzvol.value}, waitUntilDone=True)
result = airfoilPlugin.executeAction('setVolume', deviceId=1894059650, props={'volume': Dockvol.value}, waitUntilDone=True)
except Exception, e:
print "Exception occurred: %s" % unicode(e)

Posted on
Fri Jul 08, 2022 6:29 am
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Python and Airfoil

With the latest release of Indigo, your script is now running under Python 3 instead of Python2, so you need to make changes for that. See https://github.com/IndigoDomotics/Indig ... Python%203).md which is linked from https://wiki.indigodomo.com/doku.php?id ... patibility

Specifically, you need to change this line:
Code: Select all
except Exception, e:

To:
Code: Select all
except Exception as e:


You should also change the last line to:
Code: Select all
print("Exception occurred: {e}")

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Jul 08, 2022 8:08 am
Alain offline
Posts: 88
Joined: Apr 19, 2008

Re: Python and Airfoil

Thank you!

Who is online

Users browsing this forum: No registered users and 4 guests