So far, I have the process working for reading the data. The communication management class is called from plugin.py as:
Code: Select all
def runConcurrentThread(self):
threadIfkit = threading.Thread(target=self.ifkit.startPhidgetThread, name='ifKit')
threadIfkit.start()ifkit looks like:
Code: Select all
class ifkit(object):
########################################
def __init__(self, plugin):
self.plugin = plugin
self.shutdown = False
def __del__(self):
pass
######################
def startPhidgetThread(self):
indigo.server.log('ifKit thread starting', type="Phidgets Plugin")
def setOutputI(port, value):
interfaceKit.setOutputState(port, value)
def <Additional Communications functions>
...
while not self.shutdown:
time.sleep(0.5)
EDIT: FWIW, all communications from the hardware are event driven and managed by lower-level interface code provided by the manufacturer. startPhidgetThread also contains callback methods that are invoked by the lower-level interface as needed. That is why I have the endless wait loop at the bottom, waiting for these callbacks, or, my action invocation..