Inside of this request handler, I need to be able to dispatch actions to arbitrary plugins -- works great via a simple:
- Code: Select all
# get the plugin that was requested from the indigo server
indigoPlugin = indigo.server.getPlugin(pluginId)
if indigoPlugin is None:
commandResponse = u'ERROR: Invalid plugin specified'
else:
actionPropDict = eval(actionProps)
indigoPlugin.executeAction(actionId, deviceId=int(deviceId), props=actionPropDict)
commandResponse = u'OK'
The issue comes in whenever the pluginId happens to be the same plugin in which the socket server is running -- "InternalError -- cannot dispatch plugin method ExecuteAction back to the same plugin (com.duncanware.domoPadMobileClient)". I assume this is due to an attempt at inter-process communications but it is trying to talk back to itself. I get that, no problem... but the response server has no way to reference the current plugin class directly. SO, I know a few ways to handle this in other languages but what about Python -- what would be the best approach here?
Thanks!