FlyingDiver wrote:Yeah, the problem is actually that the indigo-host script only accepts a valid path for the -x option. No additional arguments allowed.
There's probably some other way to skin this cat, but they're going to be more convoluted.
One "convoluted" way is to put the device ID into a variable first and then run the script.
- Code: Select all
import sys
#replace the id of your own variable below
myDevID = int(indigo.variables[12345678].value)
devIsOn = indigo.devices[myDevID].states['onOffState']
if (devIsOn):
indigo.device.turnOff(myDevID)
else:
indigo.device.turnOn(myDevID)