First, am I violating anything by doing so (copyright, best practice, etc)?
The plug-in contains a Python script, and I'd like to use one of its methods in my own Python script, with my own parameters. I can get that to work by copying the Powerview plug-in's python script to Indigo's Scripts/Attachments folder. But I'm wondering if I can somehow access the plug-in's methods, rather than by using that copy.
I tried importing, but Indigo couldn't find the module within the plug-in, not until I copied it to the Scripts/Attachments folder. I guess the plug-in's script is not "in the path."
I found this in your online documentation:
- Code: Select all
itunesId = "com.perceptiveautomation.indigoplugin.itunes"
itunesPlugin = indigo.server.getPlugin(itunesId)
if itunesPlugin.isEnabled():
myWeatherStation = indigo.devices[1798384204]
outsideTemp = myWeatherStation.states['temperatureF']
currentCondition = myWeatherStation.states['currentCondition']
spokenString = "The current temperature is %s degrees. Current condition is %s." % (outsideTemp, currentCondition)
itunesPlugin.executeAction("pauseAndSay", deviceId=135305663, props={'message':spokenString})
And modified it so that I can get to the Powerview plug-in with this:
- Code: Select all
powerviewId = "com.perceptiveautomation.indigoplugin.PowerView"
powerviewPlugin = indigo.server.getPlugin(powerviewId)
Is it then possible to use "powerviewPlugin" to access the plug-in's methods, and send it parameters (by name?)?
The method I'm after (which belongs to a class named "Powerview") is this one (and it's "tNewPosition" that I need to manipulate):
- Code: Select all
Powerview().setShadePosition(hubHostname = tHubHostname, shadeId = tShadeId, top = 0, bottom = tNewPosition)
Or is copying the script to the attachments folder the best solution?