The following code is part of my deviceStartComm, by adding the "dev.replacePluginPropsOnServer(newProps)", deviceStartComm runs twice meaning it adds, removes, then adds the device again. I know this is due to the "dev.replacePluginPropsOnServer(newProps)" because if I remove the code it only adds the device once normally. Is there a way to add the port number to the "address" column on the ui without causing this problem?
- Code: Select all
def deviceStart(self, dev):
self.plugin.debugLog(u"deviceStart called. Adding device %s." % dev.name)
if dev.deviceTypeId == "xUSBserver":
dev.updateStateOnServer("onOffState", value=True, uiValue="on")
#get the xUSBserver port number
self.getPort(dev)
# writes the xUSBserver port number to the address column for the kUSBserver
newProps = dev.pluginProps
newProps['address'] = self.port
dev.replacePluginPropsOnServer(newProps)
if dev.deviceTypeId not in self.serverList:
self.serverList.append(dev.deviceTypeId)
kind regards,
Z