jay wrote:Unfortunately, you don't give enough detail about what this "device".py file is, how it's created, etc., so it's going to be hard to answer your question. If you're spawning a thread for each device, then you'll need to keep track of each of those thread processes in the main plugin.py file so that when an action is called (which happens on the plugin.py file) you can get the deviceId (pluginAction.deviceId in your action method) that the device wants to use then find the right device thread to send the command to.
Thanks Jay. I'm trying to set up a plugin for the Jandy pool system, and as such will likely only allow a single device (can't imagine folks having more than one pool/spa to control on a single instance of Indigo), so there will only be one thread. I will have to allow for different models of the Jandy, and will parse that using the deviceID as you suggest.
The action is getting back to the proper spot in the python.py and then device.py threads, but I'm having trouble storing the information created when opening the serial communication, using the conn = self.plugin.openSerial(dev.name, portName, 9600, timeout=1, writeTimeout=1) referenced above.
I tried adding it to the device properties, unsuccessfully.
Jim