def __init__(self, aDevName, aDevDomain, aDevType, aDevVersion, aTimeout=10, aInterface=None): """Initialise class data, start ohNet and UPnP discovery""" self.nameToFind = None self.failed = False self.evVarUint = 0 self.evVarInt = 0 self.evVarStr = 0 self.evVarBin = 0 self.nameFound = threading.Event() self.initEvent = threading.Event() self.uintChanged = threading.Event() self.intChanged = threading.Event() self.boolChanged = threading.Event() self.strChanged = threading.Event() self.binChanged = threading.Event() self.anyChanged = threading.Event() ohNet.Initialise() ohNet.Start('CP', aInterface) dev = self.FindDev(aDevName, aDevDomain, aDevType, aDevVersion, aTimeout) if dev: dev.Start() print('\n' + str(dev) + '\n') self.testBasic = dev.OpenhomeOrgTestBasic self.TestBasicProxy() dev.Shutdown() else: print('FAILED to find %s' % aDevName) if self.failed: print('\n*** FAILED ***') else: print('\n*** PASSED ***') ohNet.Shutdown() # noinspection PyProtectedMember os._exit(0)
def Shutdown( ): ohNet.Shutdown()