def testConfigureDigitalIn(self): self.doLogin() # send CD command # D1, Target A1, action On, sp 4, dw 2, udp 1, udpnode 100 for cmd in range(wb6.AT_NONE, wb6.AT_SPARE): for sp in range(0, self._spCount): if ( cmd == wb6.AT_DWELL ) or ( cmd == wb6.AT_DWELLCAN ): showWorking() for dwell in range(0, self._dwellCount): idStr = "ConfigDigIn, 1, wb6.TT_ANALOGUE, 1, cmd:" + str(cmd) + " sp:"+ str(sp) +" dw:"+str(dwell) + ",1,100" wb6.ConfigDigIn(self._wbAddress, 1,wb6.TT_ANALOGUE,1,cmd,sp,dwell,1,100 ) time.sleep(1.0) # read all the configuration and verify entries. cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._diCount): if ( idx != 1): self.verifyDiConfiguration(idx, cfg) else: di = cfg.getDigInTrigger(idx) assert di["name"] == "Sw-"+str(idx+1), idStr + " di[name]:" + str(di["name"]) assert di["action"] == wb6.ActionStrs[cmd], idStr + " di[action]:" + di["action"] assert di["actionNr"] == cmd, idStr + " di[actionNr]:" + str(di["actionNr"]) assert di["pairChn"] == 1, idStr + " di[pairChn]:" + str(di["pairChn"]) assert di["options"] == 2, idStr + " di[options]:" + str(di["options"]) assert di["dwell"] == dwell, idStr + " di[dwell]:" + str(di["dwell"]) assert di["typeNr"] == 2, idStr + " di[typeNr]:" + str(di["typeNr"]) assert di["type"] == "Analogue", idStr + " di[type]:" + str(di["type"]) assert di["setPoint"] == sp, idStr + " di[setPoint]:" + str(di["setPoint"]) assert di["UDPRem"] == "General", idStr + " di[UDPRem]:" + str(di["UDPRem"]) assert di["UDPRemNr"] == 1, idStr + " di[UDPRemNr]:" + str(di["UDPRemNr"]) assert di["RemNode"] == 100, idStr + " di[RemNode]:" + str(di["RemNode"]) else: showWorking() dwell = 0 idStr = "ConfigDigIn, 1, wb6.TT_ANALOGUE, 1, cmd:" + str(cmd) + " sp:"+ str(sp) +" dw:"+str(dwell) + ",1,100" wb6.ConfigDigIn(self._wbAddress, 1,wb6.TT_ANALOGUE,1,cmd,sp,dwell,1,100 ) time.sleep(1.0) # read all the configuration and verify entries. cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._diCount): if ( idx != 1): self.verifyDiConfiguration(idx, cfg) else: di = cfg.getDigInTrigger(idx) assert di["name"] == "Sw-"+str(idx+1), idStr + " di[name]:" + str(di["name"]) assert di["actionNr"] == cmd, idStr + " di[actionNr]:" + str(di["actionNr"]) assert di["action"] == wb6.ActionStrs[cmd], idStr + " di[action]:" + di["action"] assert di["pairChn"] == 1, idStr + " di[pairChn]:" + str(di["pairChn"]) assert di["options"] == 2, idStr + " di[options]:" + str(di["options"]) assert di["dwell"] == dwell, idStr + " di[dwell]:" + str(di["dwell"]) assert di["typeNr"] == 2, idStr + " di[typeNr]:" + str(di["typeNr"]) assert di["type"] == "Analogue", idStr + " di[type]:" + str(di["type"]) assert di["setPoint"] == sp, idStr + " di[setPoint]:" + str(di["setPoint"]) assert di["UDPRem"] == "General", idStr + " di[UDPRem]:" + str(di["UDPRem"]) assert di["UDPRemNr"] == 1, idStr + " di[UDPRemNr]:" + str(di["UDPRemNr"]) assert di["RemNode"] == 100, idStr + " di[RemNode]:" + str(di["RemNode"])
def testConfigureDigitalIn(self): doLogin(TestWbConfig._wbAddress) # send CD command # D1, Target A1, action On, sp 4, dw 2, udp 1, udpnode 100 for cmd in range(wb6.AT_NONE, wb6.AT_SPARE): for sp in range(0, TestWbConfig._spCount): if ( cmd == wb6.AT_DWELL ) or ( cmd == wb6.AT_DWELLCAN ): showWorking() for dwell in range(0, TestWbConfig._dwellCount): idStr = "ConfigDigIn, 1, wb6.TT_ANALOGUE, 1, cmd:" + str(cmd) + " sp:"+ str(sp) +" dw:"+str(dwell) + ",1,100" wb6.ConfigDigIn(TestWbConfig._wbAddress, 1,wb6.TT_ANALOGUE,1,cmd,sp,dwell,1,100 ) time.sleep(1.0) # read all the configuration and verify entries. cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) for idx in range(0,TestWbConfig._diCount): if ( idx != 1): self.verifyDiConfiguration(idx, cfg) else: di = cfg.getDigInTrigger(idx) self.assertEqual( di["name"], "Sw-"+str(idx)) self.assertEqual( di["action"], wb6.ActionStrs[cmd] ) self.assertEqual( di["actionNr"], cmd) self.assertEqual( di["pairChn"], 1) self.assertEqual( di["options"], 2) self.assertEqual( di["dwell"], dwell) self.assertEqual( di["typeNr"], 2) self.assertEqual( di["type"], "Analogue") self.assertEqual( di["setPoint"], sp) self.assertEqual( di["UDPRem"], "General") self.assertEqual( di["UDPRemNr"], 1) self.assertEqual( di["RemNode"], 100) else: showWorking() dwell = 0 idStr = "ConfigDigIn, 1, wb6.TT_ANALOGUE, 1, cmd:" + str(cmd) + " sp:"+ str(sp) +" dw:"+str(dwell) + ",1,100" wb6.ConfigDigIn(TestWbConfig._wbAddress, 1,wb6.TT_ANALOGUE,1,cmd,sp,dwell,1,100 ) time.sleep(1.0) # read all the configuration and verify entries. cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) for idx in range(0,TestWbConfig._diCount): if ( idx != 1): self.verifyDiConfiguration(idx, cfg) else: di = cfg.getDigInTrigger(idx) self.assertEqual( di["name"], "Sw-"+str(idx)) self.assertEqual( di["actionNr"], cmd) self.assertEqual( di["action"], wb6.ActionStrs[cmd]) self.assertEqual( di["pairChn"], 1) self.assertEqual( di["options"], 2) self.assertEqual( di["dwell"], dwell) self.assertEqual( di["typeNr"], 2) self.assertEqual( di["type"], "Analogue") self.assertEqual( di["setPoint"], sp) self.assertEqual( di["UDPRem"], "General") self.assertEqual( di["UDPRemNr"], 1) self.assertEqual( di["RemNode"], 100)
def factoryReset(self): logging.info("factoryReset") # send factory reset, full reset self.doLogin(underTestAddress) wb6.Send(underTestAddress, "FR1") for idx in range(0, 12): self.showWorking() time.sleep(1.0) # takes a while. # # Now test that the config is the way it would be expected # cfg = wb6Config(underTestAddress) macaddr = cfg.getMacAddress() print "\nTested Mac Address: %s" % macaddr for i in range(0, 8): di = cfg.getDigInTrigger(i) print "Digital Input %d: %s" % (i, di["actionNr"]) self.assertEqual(di, 4) for i in range(8, 12): di = cfg.getDigInTrigger(i) print "Digital Input %d: %s" % (i, di["actionNr"]) self.assertEqual(di, 0) self.assertEqual(self.ErrorCount, 0)
def factoryReset(self): logging.info( "factoryReset" ) # send factory reset, full reset self.doLogin(underTestAddress) wb6.Send(underTestAddress, "FR1" ) for idx in range(0,12): self.showWorking() time.sleep(1.0 )# takes a while. # # Now test that the config is the way it would be expected # cfg = wb6Config(underTestAddress) macaddr = cfg.getMacAddress() print "\nTested Mac Address: %s" % macaddr for i in range(0,8): di = cfg.getDigInTrigger(i) print "Digital Input %d: %s" % (i,di["actionNr"]) self.assertEqual(di,4) for i in range(8,12): di = cfg.getDigInTrigger(i) print "Digital Input %d: %s" % (i,di["actionNr"]) self.assertEqual(di,0) self.assertEqual( self.ErrorCount, 0 )
def testaScene(self): # configure a scene and verify it self.factoryReset() self.doLogin() wb6.ConfigScene(self._wbAddress, 1, ["N", "F", "I", "N", "F", "I", "N", "F"], [("S", 1), "I", ("S", 2), "I"]) time.sleep(1.0) cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._sceneCount): if idx == 1: sc = cfg.getScene(idx) self.assertEqual(sc["Digital0"], "On") self.assertEqual(sc["Digital1"], "Off") self.assertEqual(sc["Digital2"], "Ignore") self.assertEqual(sc["Digital3"], "On") self.assertEqual(sc["Digital4"], "Off") self.assertEqual(sc["Digital5"], "Ignore") self.assertEqual(sc["Digital6"], "On") self.assertEqual(sc["Digital7"], "Off") self.assertEqual(sc["Analogue0"], "SetPoint1") self.assertEqual(sc["Analogue1"], "Ignore") self.assertEqual(sc["Analogue2"], "SetPoint2") self.assertEqual(sc["Analogue3"], "Ignore") else: self.verifySceneConfiguration(idx, cfg)
def verifySetPointConfiguration(self): cfg = wb6Config.wb6Config(self._wbAddress) assert cfg.getSetPoint(0) == 0, str(cfg.getSetPoint(0)) assert cfg.getSetPoint(1) == 14, str(cfg.getSetPoint(1)) assert cfg.getSetPoint(2) == 28, str(cfg.getSetPoint(2)) assert cfg.getSetPoint(3) == 42, str(cfg.getSetPoint(3)) assert cfg.getSetPoint(4) == 57, str(cfg.getSetPoint(4)) assert cfg.getSetPoint(5) == 71, str(cfg.getSetPoint(5)) assert cfg.getSetPoint(6) == 85, str(cfg.getSetPoint(6)) assert cfg.getSetPoint(7) == 100, str(cfg.getSetPoint(7))
def verifyDwellConfiguration(self): cfg = wb6Config.wb6Config( self._wbAddress ) assert cfg.getDwell(0) == 30, str(cfg.getDwell(0)) assert cfg.getDwell(1) == 2, str(cfg.getDwell(1)) assert cfg.getDwell(2) == 60, str(cfg.getDwell(2)) assert cfg.getDwell(3) == 3600, str(cfg.getDwell(3)) assert cfg.getDwell(4) == 300, str(cfg.getDwell(4)) assert cfg.getDwell(5) == 600, str(cfg.getDwell(5)) assert cfg.getDwell(6) == 900, str(cfg.getDwell(6)) assert cfg.getDwell(7) == 1200, str(cfg.getDwell(7))
def verifySetPointConfiguration(self): cfg = wb6Config.wb6Config( self._wbAddress ) assert cfg.getSetPoint(0) == 0, str(cfg.getSetPoint(0)) assert cfg.getSetPoint(1) == 14, str(cfg.getSetPoint(1)) assert cfg.getSetPoint(2) == 28, str(cfg.getSetPoint(2)) assert cfg.getSetPoint(3) ==42, str(cfg.getSetPoint(3)) assert cfg.getSetPoint(4) == 57, str(cfg.getSetPoint(4)) assert cfg.getSetPoint(5) == 71, str(cfg.getSetPoint(5)) assert cfg.getSetPoint(6) == 85, str(cfg.getSetPoint(6)) assert cfg.getSetPoint(7) == 100, str(cfg.getSetPoint(7))
def verifyDwellConfiguration(self): cfg = wb6Config.wb6Config(self._wbAddress) assert cfg.getDwell(0) == 30, str(cfg.getDwell(0)) assert cfg.getDwell(1) == 2, str(cfg.getDwell(1)) assert cfg.getDwell(2) == 60, str(cfg.getDwell(2)) assert cfg.getDwell(3) == 3600, str(cfg.getDwell(3)) assert cfg.getDwell(4) == 300, str(cfg.getDwell(4)) assert cfg.getDwell(5) == 600, str(cfg.getDwell(5)) assert cfg.getDwell(6) == 900, str(cfg.getDwell(6)) assert cfg.getDwell(7) == 1200, str(cfg.getDwell(7))
def testConfigureAnThreshold(self): self.doLogin() # send CD command # D1, Target A1, action On, sp 4, dw 2, udp 1, udpnode 100 wb6.ConfigAnIn(self._wbAddress, 1, "L", 17, wb6.TT_ANALOGUE, 2, wb6.AT_ON, wb6.SP_4, wb6.DW_2, wb6.UDPT_GENERAL, 99) wb6.ConfigAnIn(self._wbAddress, 1, "H", 87, wb6.TT_DIGITAL, 2, wb6.AT_ON, wb6.SP_0, wb6.DW_2, wb6.UDPT_GENERAL, 99) idStr = "ConfigAnIn, 1" time.sleep(0.5) # read all the configuration and verify entries. cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._aiCount): if (idx != 1): self.verifyAiConfiguration(idx, cfg) else: ai = cfg.getAnalogueTriggerLow(idx) assert ai["name"] == "AnIn-" + str( idx + 1), idStr + " ai[name]:" + str(ai["name"]) assert ai["threshold"] == 17, str(ai["threshold"]) assert ai["actionNr"] == 2, str(ai["actionNr"]) assert ai["action"] == "On", ai["action"] assert ai["pairChn"] == 2, str(ai["pairChn"]) assert ai["dwell"] == 2, str(ai["dwell"]) assert ai["typeNr"] == 2, str(ai["typeNr"]) assert ai["type"] == "Analogue", ai["type"] assert ai["setPoint"] == 4, str(ai["setPoint"]) assert ai["UDPRem"] == "General", ai["UDPRem"] assert ai["UDPRemNr"] == 1, str(ai["UDPRemNr"]) assert ai["RemNode"] == 99, str(ai["RemNode"]) ai = cfg.getAnalogueTriggerHigh(idx) assert ai["name"] == "AnIn-" + str( idx + 1), idStr + " ai[name]:" + str(ai["name"]) assert ai["threshold"] == 87, str(ai["threshold"]) assert ai["actionNr"] == 2, str(ai["actionNr"]) assert ai["action"] == "On", ai["action"] assert ai["pairChn"] == 2, str(ai["pairChn"]) assert ai["dwell"] == 2, str(ai["dwell"]) assert ai["typeNr"] == 0, str(ai["typeNr"]) assert ai["type"] == "Digital", ai["type"] assert ai["setPoint"] == 0, str( ai["setPoint"]) # not relevant to digital assert ai["UDPRem"] == "General", ai["UDPRem"] assert ai["UDPRemNr"] == 1, str(ai["UDPRemNr"]) assert ai["RemNode"] == 99, str(ai["RemNode"]) return
def testConfigureTempThreshold(self): self.doLogin() # send CD command wb6.ConfigTemp(self._wbAddress, 1, "L", -14, wb6.TT_ANALOGUE, 2, wb6.AT_ON, wb6.SP_4, wb6.DW_2, wb6.UDPT_GENERAL, 99) wb6.ConfigTemp(self._wbAddress, 1, "H", 57, wb6.TT_DIGITAL, 2, wb6.AT_ON, wb6.SP_0, wb6.DW_2, wb6.UDPT_GENERAL, 99) idStr = "ConfigTemp, 1" time.sleep(0.5) # read all the configuration and verify entries. cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._tempCount): if (idx != 1): self.verifyTempConfiguration(idx, cfg) else: ti = cfg.getTempTriggerLow(idx) assert ti["name"] == "Temp-" + str( idx + 1), idStr + " ti[name]:" + str(ti["name"]) assert ti["threshold"] == -14, str(ti["threshold"]) assert ti["actionNr"] == 2, str(ti["actionNr"]) assert ti["action"] == "On", ti["action"] assert ti["pairChn"] == 2, str(ti["pairChn"]) assert ti["dwell"] == 2, str(ti["dwell"]) assert ti["typeNr"] == 2, str(ti["typeNr"]) assert ti["type"] == "Analogue", ti["type"] assert ti["setPoint"] == 4, str(ti["setPoint"]) assert ti["UDPRem"] == "General", ti["UDPRem"] assert ti["UDPRemNr"] == 1, str(ti["UDPRemNr"]) assert ti["RemNode"] == 99, str(ti["RemNode"]) ti = cfg.getTempTriggerHigh(idx) assert ti["name"] == "Temp-" + str( idx + 1), idStr + " ti[name]:" + str(ti["name"]) assert ti["threshold"] == 57, str(ti["threshold"]) assert ti["actionNr"] == 2, str(ti["actionNr"]) assert ti["action"] == "On", ti["action"] assert ti["pairChn"] == 2, str(ti["pairChn"]) assert ti["dwell"] == 2, str(ti["dwell"]) assert ti["typeNr"] == 0, str(ti["typeNr"]) assert ti["type"] == "Digital", ti["type"] assert ti["setPoint"] == 0, str( ti["setPoint"]) # not relevant to digital assert ti["UDPRem"] == "General", ti["UDPRem"] assert ti["UDPRemNr"] == 1, str(ti["UDPRemNr"]) assert ti["RemNode"] == 99, str(ti["RemNode"]) return
def testConfigureAnThreshold(self): doLogin(TestWbConfig._wbAddress) # send CD command # D1, Target A1, action On, sp 4, dw 2, udp 1, udpnode 100 wb6.ConfigAnIn(TestWbConfig._wbAddress, 1, "L", 17, wb6.TT_ANALOGUE, 2, wb6.AT_ON, wb6.SP_4, wb6.DW_2, wb6.UDPT_GENERAL, 99) wb6.ConfigAnIn(TestWbConfig._wbAddress, 1, "H", 87, wb6.TT_DIGITAL, 2, wb6.AT_ON, wb6.SP_0, wb6.DW_2, wb6.UDPT_GENERAL, 99) idStr = "ConfigAnIn, 1" time.sleep(0.5) # read all the configuration and verify entries. cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) for idx in range(0, TestWbConfig._aiCount): if (idx != 1): self.verifyAiConfiguration(idx, cfg) else: ai = cfg.getAnalogueTriggerLow(idx) self.assertEqual(ai["name"], "AnIn-" + str(idx)) self.assertEqual(ai["threshold"], 17) self.assertEqual(ai["actionNr"], 2) self.assertEqual(ai["action"], "On") self.assertEqual(ai["pairChn"], 2) self.assertEqual(ai["dwell"], 2) self.assertEqual(ai["typeNr"], 2) self.assertEqual(ai["type"], "Analogue") self.assertEqual(ai["setPoint"], 4) self.assertEqual(ai["UDPRem"], "General") self.assertEqual(ai["UDPRemNr"], 1) self.assertEqual(ai["RemNode"], 99) ai = cfg.getAnalogueTriggerHigh(idx) self.assertEqual(ai["name"], "AnIn-" + str(idx), idStr) self.assertEqual(ai["threshold"], 87) self.assertEqual(ai["actionNr"], 2) self.assertEqual(ai["action"], "On") self.assertEqual(ai["pairChn"], 2) self.assertEqual(ai["dwell"], 2) self.assertEqual(ai["typeNr"], 0) self.assertEqual(ai["type"], "Digital") self.assertEqual(ai["setPoint"], 0) self.assertEqual(ai["UDPRem"], "General") self.assertEqual(ai["UDPRemNr"], 1) self.assertEqual(ai["RemNode"], 99) return
def testConfigureTempThreshold(self): doLogin(TestWbConfig._wbAddress) # send CD command wb6.ConfigTemp(TestWbConfig._wbAddress, 1, "L", -14, wb6.TT_ANALOGUE, 2, wb6.AT_ON, wb6.SP_4, wb6.DW_2, wb6.UDPT_GENERAL, 99) wb6.ConfigTemp(TestWbConfig._wbAddress, 1, "H", 57, wb6.TT_DIGITAL, 2, wb6.AT_ON, wb6.SP_0, wb6.DW_2, wb6.UDPT_GENERAL, 99) idStr = "ConfigTemp, 1" time.sleep(0.5) # read all the configuration and verify entries. cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) for idx in range(0, TestWbConfig._tempCount): if (idx != 1): self.verifyTempConfiguration(idx, cfg) else: ti = cfg.getTempTriggerLow(idx) self.assertEqual(ti["name"], "Temp-" + str(idx), idStr) self.assertEqual(ti["threshold"], -14) self.assertEqual(ti["actionNr"], 2) self.assertEqual(ti["action"], "On") self.assertEqual(ti["pairChn"], 2) self.assertEqual(ti["dwell"], 2) self.assertEqual(ti["typeNr"], 2) self.assertEqual(ti["type"], "Analogue") self.assertEqual(ti["setPoint"], 4) self.assertEqual(ti["UDPRem"], "General") self.assertEqual(ti["UDPRemNr"], 1) self.assertEqual(ti["RemNode"], 99) ti = cfg.getTempTriggerHigh(idx) self.assertEqual(ti["name"], "Temp-" + str(idx), idStr) self.assertEqual(ti["threshold"], 57) self.assertEqual(ti["actionNr"], 2) self.assertEqual(ti["action"], "On") self.assertEqual(ti["pairChn"], 2) self.assertEqual(ti["dwell"], 2) self.assertEqual(ti["typeNr"], 0) self.assertEqual(ti["type"], "Digital") self.assertEqual(ti["setPoint"], 0) self.assertEqual(ti["UDPRem"], "General") self.assertEqual(ti["UDPRemNr"], 1) self.assertEqual(ti["RemNode"], 99) return
def testConfigureAnThreshold(self): self.doLogin() # send CD command # D1, Target A1, action On, sp 4, dw 2, udp 1, udpnode 100 wb6.ConfigAnIn(self._wbAddress, 1, "L", 17, wb6.TT_ANALOGUE, 2, wb6.AT_ON, wb6.SP_4, wb6.DW_2, wb6.UDPT_GENERAL, 99 ) wb6.ConfigAnIn(self._wbAddress, 1, "H", 87, wb6.TT_DIGITAL, 2, wb6.AT_ON, wb6.SP_0, wb6.DW_2, wb6.UDPT_GENERAL, 99 ) idStr = "ConfigAnIn, 1" time.sleep(0.5) # read all the configuration and verify entries. cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._aiCount): if ( idx != 1): self.verifyAiConfiguration(idx, cfg) else: ai = cfg.getAnalogueTriggerLow(idx) assert ai["name"] == "AnIn-"+str(idx+1), idStr + " ai[name]:" + str(ai["name"]) assert ai["threshold"] == 17, str(ai["threshold"]) assert ai["actionNr"] == 2, str(ai["actionNr"]) assert ai["action"] == "On", ai["action"] assert ai["pairChn"] == 2, str(ai["pairChn"]) assert ai["dwell"] == 2, str(ai["dwell"]) assert ai["typeNr"] == 2, str(ai["typeNr"]) assert ai["type"] == "Analogue", ai["type"] assert ai["setPoint"] == 4, str(ai["setPoint"]) assert ai["UDPRem"] == "General", ai["UDPRem"] assert ai["UDPRemNr"] == 1, str(ai["UDPRemNr"]) assert ai["RemNode"] == 99, str(ai["RemNode"]) ai = cfg.getAnalogueTriggerHigh(idx) assert ai["name"] == "AnIn-"+str(idx+1), idStr + " ai[name]:" + str(ai["name"]) assert ai["threshold"] == 87, str(ai["threshold"]) assert ai["actionNr"] == 2, str(ai["actionNr"]) assert ai["action"] == "On", ai["action"] assert ai["pairChn"] == 2, str(ai["pairChn"]) assert ai["dwell"] == 2, str(ai["dwell"]) assert ai["typeNr"] == 0, str(ai["typeNr"]) assert ai["type"] == "Digital", ai["type"] assert ai["setPoint"] == 0, str(ai["setPoint"]) # not relevant to digital assert ai["UDPRem"] == "General", ai["UDPRem"] assert ai["UDPRemNr"] == 1, str(ai["UDPRemNr"]) assert ai["RemNode"] == 99, str(ai["RemNode"]) return
def testConfigureAnThreshold(self): doLogin(TestWbConfig._wbAddress) # send CD command # D1, Target A1, action On, sp 4, dw 2, udp 1, udpnode 100 wb6.ConfigAnIn(TestWbConfig._wbAddress, 1, "L", 17, wb6.TT_ANALOGUE, 2, wb6.AT_ON, wb6.SP_4, wb6.DW_2, wb6.UDPT_GENERAL, 99 ) wb6.ConfigAnIn(TestWbConfig._wbAddress, 1, "H", 87, wb6.TT_DIGITAL, 2, wb6.AT_ON, wb6.SP_0, wb6.DW_2, wb6.UDPT_GENERAL, 99 ) idStr = "ConfigAnIn, 1" time.sleep(0.5) # read all the configuration and verify entries. cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) for idx in range(0,TestWbConfig._aiCount): if ( idx != 1): self.verifyAiConfiguration(idx, cfg) else: ai = cfg.getAnalogueTriggerLow(idx) self.assertEqual( ai["name"] , "AnIn-"+str(idx)) self.assertEqual( ai["threshold"] , 17) self.assertEqual( ai["actionNr"] , 2) self.assertEqual( ai["action"] , "On") self.assertEqual( ai["pairChn"] , 2) self.assertEqual( ai["dwell"] , 2) self.assertEqual( ai["typeNr"] , 2) self.assertEqual( ai["type"] , "Analogue") self.assertEqual( ai["setPoint"] , 4) self.assertEqual( ai["UDPRem"] , "General") self.assertEqual( ai["UDPRemNr"] , 1) self.assertEqual( ai["RemNode"] , 99) ai = cfg.getAnalogueTriggerHigh(idx) self.assertEqual( ai["name"] , "AnIn-"+str(idx), idStr) self.assertEqual( ai["threshold"] , 87) self.assertEqual( ai["actionNr"] , 2) self.assertEqual( ai["action"] , "On") self.assertEqual( ai["pairChn"] , 2) self.assertEqual( ai["dwell"] , 2) self.assertEqual( ai["typeNr"] , 0) self.assertEqual( ai["type"] , "Digital") self.assertEqual( ai["setPoint"] , 0) self.assertEqual( ai["UDPRem"] , "General" ) self.assertEqual( ai["UDPRemNr"] , 1) self.assertEqual( ai["RemNode"] , 99) return
def testConfigureTempThreshold(self): self.doLogin() # send CD command wb6.ConfigTemp(self._wbAddress, 1, "L", -14, wb6.TT_ANALOGUE, 2, wb6.AT_ON, wb6.SP_4, wb6.DW_2, wb6.UDPT_GENERAL, 99 ) wb6.ConfigTemp(self._wbAddress, 1, "H", 57, wb6.TT_DIGITAL, 2, wb6.AT_ON, wb6.SP_0, wb6.DW_2, wb6.UDPT_GENERAL, 99 ) idStr = "ConfigTemp, 1" time.sleep(0.5) # read all the configuration and verify entries. cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._tempCount): if ( idx != 1): self.verifyTempConfiguration(idx, cfg) else: ti = cfg.getTempTriggerLow(idx) assert ti["name"] == "Temp-"+str(idx+1), idStr + " ti[name]:" + str(ti["name"]) assert ti["threshold"] == -14, str(ti["threshold"]) assert ti["actionNr"] == 2, str(ti["actionNr"]) assert ti["action"] == "On", ti["action"] assert ti["pairChn"] == 2, str(ti["pairChn"]) assert ti["dwell"] == 2, str(ti["dwell"]) assert ti["typeNr"] == 2, str(ti["typeNr"]) assert ti["type"] == "Analogue", ti["type"] assert ti["setPoint"] == 4, str(ti["setPoint"]) assert ti["UDPRem"] == "General", ti["UDPRem"] assert ti["UDPRemNr"] == 1, str(ti["UDPRemNr"]) assert ti["RemNode"] == 99, str(ti["RemNode"]) ti = cfg.getTempTriggerHigh(idx) assert ti["name"] == "Temp-"+str(idx+1), idStr + " ti[name]:" + str(ti["name"]) assert ti["threshold"] == 57, str(ti["threshold"]) assert ti["actionNr"] == 2, str(ti["actionNr"]) assert ti["action"] == "On", ti["action"] assert ti["pairChn"] == 2, str(ti["pairChn"]) assert ti["dwell"] == 2, str(ti["dwell"]) assert ti["typeNr"] == 0, str(ti["typeNr"]) assert ti["type"] == "Digital", ti["type"] assert ti["setPoint"] == 0, str(ti["setPoint"]) # not relevant to digital assert ti["UDPRem"] == "General", ti["UDPRem"] assert ti["UDPRemNr"] == 1, str(ti["UDPRemNr"]) assert ti["RemNode"] == 99, str(ti["RemNode"]) return
def testConfigureTempThreshold(self): doLogin(TestWbConfig._wbAddress) # send CD command wb6.ConfigTemp(TestWbConfig._wbAddress, 1, "L", -14, wb6.TT_ANALOGUE, 2, wb6.AT_ON, wb6.SP_4, wb6.DW_2, wb6.UDPT_GENERAL, 99 ) wb6.ConfigTemp(TestWbConfig._wbAddress, 1, "H", 57, wb6.TT_DIGITAL, 2, wb6.AT_ON, wb6.SP_0, wb6.DW_2, wb6.UDPT_GENERAL, 99 ) idStr = "ConfigTemp, 1" time.sleep(0.5) # read all the configuration and verify entries. cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) for idx in range(0,TestWbConfig._tempCount): if ( idx != 1): self.verifyTempConfiguration(idx, cfg) else: ti = cfg.getTempTriggerLow(idx) self.assertEqual( ti["name"] , "Temp-"+str(idx), idStr) self.assertEqual( ti["threshold"] , -14) self.assertEqual( ti["actionNr"] , 2) self.assertEqual( ti["action"] , "On") self.assertEqual( ti["pairChn"] , 2) self.assertEqual( ti["dwell"] , 2) self.assertEqual( ti["typeNr"] , 2) self.assertEqual( ti["type"] , "Analogue") self.assertEqual( ti["setPoint"] , 4) self.assertEqual( ti["UDPRem"] , "General") self.assertEqual( ti["UDPRemNr"] , 1) self.assertEqual( ti["RemNode"] , 99) ti = cfg.getTempTriggerHigh(idx) self.assertEqual( ti["name"] , "Temp-"+str(idx), idStr) self.assertEqual( ti["threshold"] , 57) self.assertEqual( ti["actionNr"] , 2) self.assertEqual( ti["action"] , "On") self.assertEqual( ti["pairChn"] , 2) self.assertEqual( ti["dwell"] , 2) self.assertEqual( ti["typeNr"] , 0) self.assertEqual( ti["type"] , "Digital") self.assertEqual( ti["setPoint"] , 0) self.assertEqual( ti["UDPRem"] , "General") self.assertEqual( ti["UDPRemNr"] , 1) self.assertEqual( ti["RemNode"] , 99) return
def testScheduledEvent(self): self.doSetTime(1, 1, 1) # Create a scheduled event wb6.ConfigScheduled(self._wbAddress, 1, "1", 1, 2, wb6.TT_DIGITAL, 3, wb6.AT_TOGGLE, wb6.SP_0, wb6.DW_0, wb6.UDPT_GENERAL, 98) time.sleep(0.5) sts = wb6Status.wb6Status(self._wbAddress) assert sts.getError() == 0 cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._schedCount): if (idx == 1): sc = cfg.getScheduledEvent(idx) assert sc["days"] == 2, str(sc["days"]) assert sc["hours"] == 1, str(sc["hours "]) assert sc["mins"] == 2, str(sc["mins"]) assert sc["actionNr"] == 4, str(sc["actionNr"]) assert sc["action"] == "Toggle", sc["action"] assert sc["pairChn"] == 3, str(sc["pairChn"]) assert sc["dwell"] == 0, str(sc["dwell"]) assert sc["typeNr"] == 0, str(sc["typeNr"]) assert sc["type"] == "Digital", sc["type"] assert sc["setPoint"] == 0, str(sc["setPoint"]) assert sc["UDPRemNr"] == 1, str(sc["UDPRemNr"]) assert sc["UDPRem"] == "General", sc["UDPRem"] assert sc["RemNode"] == 98, str(sc["RemNode"]) else: self.verifyScheduleConfiguration(idx, cfg) cur = sts.getDigOut(3) # wait for it to run? while (sts.getTime() < "01:02:00"): time.sleep(1.0) showWait() sts = wb6Status.wb6Status(self._wbAddress) # ensure it has a chance to run time.sleep(1.0) sts = wb6Status.wb6Status(self._wbAddress) assert (cur <> sts.getDigOut(3)), str( sts.getDigOut(3)) # did it toggle
def testScheduledEvent(self): self.doSetTime(1, 1, 1) # Create a scheduled event wb6.ConfigScheduled(TestWbConfig._wbAddress, 1, "1", 1, 2, wb6.TT_DIGITAL, 3, wb6.AT_TOGGLE, wb6.SP_0, wb6.DW_0, wb6.UDPT_GENERAL, 98) time.sleep(0.5) sts = wb6Status.wb6Status(TestWbConfig._wbAddress) self.assertEqual(sts.getError(), 0) cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) for idx in range(0, TestWbConfig._schedCount): if (idx == 1): sc = cfg.getScheduledEvent(idx) self.assertEqual(sc["days"], 2) self.assertEqual(sc["hours"], 1) self.assertEqual(sc["mins"], 2) self.assertEqual(sc["actionNr"], 4) self.assertEqual(sc["action"], "Toggle") self.assertEqual(sc["pairChn"], 3) self.assertEqual(sc["dwell"], 0) self.assertEqual(sc["typeNr"], 0) self.assertEqual(sc["type"], "Digital") self.assertEqual(sc["setPoint"], 0) self.assertEqual(sc["UDPRemNr"], 1) self.assertEqual(sc["UDPRem"], "General") self.assertEqual(sc["RemNode"], 98) else: self.verifyScheduleConfiguration(idx, cfg) cur = sts.getDigOut(3) # wait for it to run? while (sts.getTime() < "01:02:00"): time.sleep(1.0) showWait() sts = wb6Status.wb6Status(TestWbConfig._wbAddress) # ensure it has a chance to run time.sleep(1.0) sts = wb6Status.wb6Status(TestWbConfig._wbAddress) self.assertNotEqual(cur, sts.getDigOut(3))
def testScheduledEvent(self): self.doSetTime( 1, 1, 1 ) # Create a scheduled event wb6.ConfigScheduled( self._wbAddress, 1, "1", 1, 2, wb6.TT_DIGITAL, 3, wb6.AT_TOGGLE, wb6.SP_0, wb6.DW_0, wb6.UDPT_GENERAL, 98 ) time.sleep(0.5) sts = wb6Status.wb6Status( self._wbAddress ) assert sts.getError() == 0 cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._schedCount): if ( idx == 1 ): sc = cfg.getScheduledEvent(idx) assert sc["days"] == 2, str(sc["days"]) assert sc["hours"] == 1, str(sc["hours "]) assert sc["mins"] == 2, str(sc["mins"]) assert sc["actionNr"] == 4, str(sc["actionNr"]) assert sc["action"] == "Toggle", sc["action"] assert sc["pairChn"] == 3, str(sc["pairChn"]) assert sc["dwell"] == 0, str(sc["dwell"]) assert sc["typeNr"] == 0, str(sc["typeNr"]) assert sc["type"] == "Digital", sc["type"] assert sc["setPoint"] == 0, str(sc["setPoint"]) assert sc["UDPRemNr"] == 1, str(sc["UDPRemNr"]) assert sc["UDPRem"] == "General", sc["UDPRem"] assert sc["RemNode"] == 98, str(sc["RemNode"]) else: self.verifyScheduleConfiguration(idx, cfg) cur = sts.getDigOut(3); # wait for it to run? while ( sts.getTime() < "01:02:00" ): time.sleep(1.0) showWait() sts = wb6Status.wb6Status( self._wbAddress ) # ensure it has a chance to run time.sleep(1.0) sts = wb6Status.wb6Status( self._wbAddress ) assert (cur <> sts.getDigOut(3)),str(sts.getDigOut(3)) # did it toggle
def testaScene(self): # configure a scene and verify it self.factoryReset() self.doLogin() wb6.ConfigScene(self._wbAddress, 1, ["N","F","I","N","F","I","N","F"], [("S",1),"I",("S",2),"I"] ) time.sleep(1.0) cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._sceneCount): if idx == 1 : sc = cfg.getScene(idx) self.assertEqual( sc["Digital0"], "On") self.assertEqual( sc["Digital1"], "Off") self.assertEqual( sc["Digital2"], "Ignore") self.assertEqual( sc["Digital3"], "On") self.assertEqual( sc["Digital4"], "Off") self.assertEqual( sc["Digital5"], "Ignore") self.assertEqual( sc["Digital6"], "On") self.assertEqual( sc["Digital7"], "Off") self.assertEqual( sc["Analogue0"], "SetPoint1") self.assertEqual( sc["Analogue1"], "Ignore") self.assertEqual( sc["Analogue2"], "SetPoint2") self.assertEqual( sc["Analogue3"], "Ignore") else: self.verifySceneConfiguration(idx, cfg)
def testScheduledEvent(self): self.doSetTime( 1, 1, 1 ) # Create a scheduled event wb6.ConfigScheduled( TestWbConfig._wbAddress, 1, "1", 1, 2, wb6.TT_DIGITAL, 3, wb6.AT_TOGGLE, wb6.SP_0, wb6.DW_0, wb6.UDPT_GENERAL, 98 ) time.sleep(0.5) sts = wb6Status.wb6Status( TestWbConfig._wbAddress ) self.assertEqual( sts.getError(), 0 ) cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) for idx in range(0,TestWbConfig._schedCount): if ( idx == 1 ): sc = cfg.getScheduledEvent(idx) self.assertEqual( sc["days"] , 2) self.assertEqual( sc["hours"] , 1) self.assertEqual( sc["mins"] , 2) self.assertEqual( sc["actionNr"] , 4) self.assertEqual( sc["action"] , "Toggle") self.assertEqual( sc["pairChn"] , 3) self.assertEqual( sc["dwell"] , 0) self.assertEqual( sc["typeNr"] , 0) self.assertEqual( sc["type"] , "Digital") self.assertEqual( sc["setPoint"] , 0) self.assertEqual( sc["UDPRemNr"] , 1) self.assertEqual( sc["UDPRem"] , "General") self.assertEqual( sc["RemNode"] , 98) else: self.verifyScheduleConfiguration(idx, cfg) cur = sts.getDigOut(3); # wait for it to run? while ( sts.getTime() < "01:02:00" ): time.sleep(1.0) showWait() sts = wb6Status.wb6Status( TestWbConfig._wbAddress ) # ensure it has a chance to run time.sleep(1.0) sts = wb6Status.wb6Status( TestWbConfig._wbAddress ) self.assertNotEqual(cur,sts.getDigOut(3))
def verifyDoNameConfiguration(self): cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._doCount): assert cfg.getDigOutName(idx) == "DigOut-"+str(idx+1), cfg.getDigOutName(idx)
def verifySetPointConfiguration(self): cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) self.assertEqual(cfg.getSetPoint(0), 0) self.assertEqual(cfg.getSetPoint(1), 14) self.assertEqual(cfg.getSetPoint(2), 28) self.assertEqual(cfg.getSetPoint(3), 42)
def verifyTemperatures(self): cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._tempCount): self.verifyTempConfiguration(idx, cfg)
def verifyAoNameConfiguration(self): cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) for idx in range(0, TestWbConfig._aoCount): self.assertEqual(cfg.getAnalogueOutName(idx), "AnOut-" + str(idx))
def verifyRotary(self): cfg = wb6Config.wb6Config( self._wbAddress ) assert cfg.getRotary(0 ) == 8, str(cfg.getRotary(0)) assert cfg.getRotary(1 ) == 8, str(cfg.getRotary(1)) return
def verifyDigitalIn(self): cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._diCount): self.verifyDiConfiguration(idx, cfg)
def testConfigureDigitalIn(self): doLogin(TestWbConfig._wbAddress) # send CD command # D1, Target A1, action On, sp 4, dw 2, udp 1, udpnode 100 for cmd in range(wb6.AT_NONE, wb6.AT_SPARE): for sp in range(0, TestWbConfig._spCount): if (cmd == wb6.AT_DWELL) or (cmd == wb6.AT_DWELLCAN): showWorking() for dwell in range(0, TestWbConfig._dwellCount): idStr = "ConfigDigIn, 1, wb6.TT_ANALOGUE, 1, cmd:" + str( cmd) + " sp:" + str(sp) + " dw:" + str( dwell) + ",1,100" wb6.ConfigDigIn(TestWbConfig._wbAddress, 1, wb6.TT_ANALOGUE, 1, cmd, sp, dwell, 1, 100) time.sleep(1.0) # read all the configuration and verify entries. cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) for idx in range(0, TestWbConfig._diCount): if (idx != 1): self.verifyDiConfiguration(idx, cfg) else: di = cfg.getDigInTrigger(idx) self.assertEqual(di["name"], "Sw-" + str(idx)) self.assertEqual(di["action"], wb6.ActionStrs[cmd]) self.assertEqual(di["actionNr"], cmd) self.assertEqual(di["pairChn"], 1) self.assertEqual(di["options"], 2) self.assertEqual(di["dwell"], dwell) self.assertEqual(di["typeNr"], 2) self.assertEqual(di["type"], "Analogue") self.assertEqual(di["setPoint"], sp) self.assertEqual(di["UDPRem"], "General") self.assertEqual(di["UDPRemNr"], 1) self.assertEqual(di["RemNode"], 100) else: showWorking() dwell = 0 idStr = "ConfigDigIn, 1, wb6.TT_ANALOGUE, 1, cmd:" + str( cmd) + " sp:" + str(sp) + " dw:" + str( dwell) + ",1,100" wb6.ConfigDigIn(TestWbConfig._wbAddress, 1, wb6.TT_ANALOGUE, 1, cmd, sp, dwell, 1, 100) time.sleep(1.0) # read all the configuration and verify entries. cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) for idx in range(0, TestWbConfig._diCount): if (idx != 1): self.verifyDiConfiguration(idx, cfg) else: di = cfg.getDigInTrigger(idx) self.assertEqual(di["name"], "Sw-" + str(idx)) self.assertEqual(di["actionNr"], cmd) self.assertEqual(di["action"], wb6.ActionStrs[cmd]) self.assertEqual(di["pairChn"], 1) self.assertEqual(di["options"], 2) self.assertEqual(di["dwell"], dwell) self.assertEqual(di["typeNr"], 2) self.assertEqual(di["type"], "Analogue") self.assertEqual(di["setPoint"], sp) self.assertEqual(di["UDPRem"], "General") self.assertEqual(di["UDPRemNr"], 1) self.assertEqual(di["RemNode"], 100)
def verifyIp(self): cfg = wb6Config.wb6Config( self._wbAddress ) return
def verifyScenes(self): cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._sceneCount): self.verifySceneConfiguration(idx, cfg)
def verifyDoNameConfiguration(self): cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._doCount): assert cfg.getDigOutName( idx) == "DigOut-" + str(idx + 1), cfg.getDigOutName(idx)
def verifyRotary(self): cfg = wb6Config.wb6Config(self._wbAddress) assert cfg.getRotary(0) == 8, str(cfg.getRotary(0)) assert cfg.getRotary(1) == 8, str(cfg.getRotary(1)) return
def verifyName(self): cfg = wb6Config.wb6Config(self._wbAddress) assert cfg.getNodeName() == "UnNamed", cfg.getNodeName() return
def verifyIp(self): cfg = wb6Config.wb6Config(self._wbAddress) return
def testConfigureDigitalIn(self): self.doLogin() # send CD command # D1, Target A1, action On, sp 4, dw 2, udp 1, udpnode 100 for cmd in range(wb6.AT_NONE, wb6.AT_SPARE): for sp in range(0, self._spCount): if (cmd == wb6.AT_DWELL) or (cmd == wb6.AT_DWELLCAN): showWorking() for dwell in range(0, self._dwellCount): idStr = "ConfigDigIn, 1, wb6.TT_ANALOGUE, 1, cmd:" + str( cmd) + " sp:" + str(sp) + " dw:" + str( dwell) + ",1,100" wb6.ConfigDigIn(self._wbAddress, 1, wb6.TT_ANALOGUE, 1, cmd, sp, dwell, 1, 100) time.sleep(1.0) # read all the configuration and verify entries. cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._diCount): if (idx != 1): self.verifyDiConfiguration(idx, cfg) else: di = cfg.getDigInTrigger(idx) assert di["name"] == "Sw-" + str( idx + 1), idStr + " di[name]:" + str( di["name"]) assert di["action"] == wb6.ActionStrs[ cmd], idStr + " di[action]:" + di["action"] assert di[ "actionNr"] == cmd, idStr + " di[actionNr]:" + str( di["actionNr"]) assert di[ "pairChn"] == 1, idStr + " di[pairChn]:" + str( di["pairChn"]) assert di[ "options"] == 2, idStr + " di[options]:" + str( di["options"]) assert di[ "dwell"] == dwell, idStr + " di[dwell]:" + str( di["dwell"]) assert di[ "typeNr"] == 2, idStr + " di[typeNr]:" + str( di["typeNr"]) assert di[ "type"] == "Analogue", idStr + " di[type]:" + str( di["type"]) assert di[ "setPoint"] == sp, idStr + " di[setPoint]:" + str( di["setPoint"]) assert di[ "UDPRem"] == "General", idStr + " di[UDPRem]:" + str( di["UDPRem"]) assert di[ "UDPRemNr"] == 1, idStr + " di[UDPRemNr]:" + str( di["UDPRemNr"]) assert di[ "RemNode"] == 100, idStr + " di[RemNode]:" + str( di["RemNode"]) else: showWorking() dwell = 0 idStr = "ConfigDigIn, 1, wb6.TT_ANALOGUE, 1, cmd:" + str( cmd) + " sp:" + str(sp) + " dw:" + str( dwell) + ",1,100" wb6.ConfigDigIn(self._wbAddress, 1, wb6.TT_ANALOGUE, 1, cmd, sp, dwell, 1, 100) time.sleep(1.0) # read all the configuration and verify entries. cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._diCount): if (idx != 1): self.verifyDiConfiguration(idx, cfg) else: di = cfg.getDigInTrigger(idx) assert di["name"] == "Sw-" + str( idx + 1), idStr + " di[name]:" + str( di["name"]) assert di[ "actionNr"] == cmd, idStr + " di[actionNr]:" + str( di["actionNr"]) assert di["action"] == wb6.ActionStrs[ cmd], idStr + " di[action]:" + di["action"] assert di[ "pairChn"] == 1, idStr + " di[pairChn]:" + str( di["pairChn"]) assert di[ "options"] == 2, idStr + " di[options]:" + str( di["options"]) assert di[ "dwell"] == dwell, idStr + " di[dwell]:" + str( di["dwell"]) assert di[ "typeNr"] == 2, idStr + " di[typeNr]:" + str( di["typeNr"]) assert di[ "type"] == "Analogue", idStr + " di[type]:" + str( di["type"]) assert di[ "setPoint"] == sp, idStr + " di[setPoint]:" + str( di["setPoint"]) assert di[ "UDPRem"] == "General", idStr + " di[UDPRem]:" + str( di["UDPRem"]) assert di[ "UDPRemNr"] == 1, idStr + " di[UDPRemNr]:" + str( di["UDPRemNr"]) assert di[ "RemNode"] == 100, idStr + " di[RemNode]:" + str( di["RemNode"])
def verifyAoNameConfiguration(self): cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._aoCount): assert cfg.getAnalogueOutName( idx) == "AnOut-" + str(idx + 1), cfg.getAnalogueOutName(idx)
import sys sys.path.append('../API') import wb6Config test_ip = "10.100.100.100"; wb6Cfg = wb6Config.wb6Config( test_ip ); print "Version = " + wb6Cfg.getVersion() print "NodeName = " + wb6Cfg.getNodeName() print "NodeNumber = " + str(wb6Cfg.getNodeNumber()) print "FadeRate = " + str(wb6Cfg.getFadeRate()) print "IpAddress = " + str(wb6Cfg.getIpAddress()) print "MAC Address = " + str(wb6Cfg.getMacAddress()) print "Rotary 0 = " + str(wb6Cfg.getRotary(0)) print "Dwell 0 = " + str(wb6Cfg.getDwell(0)) print "Dwell 0 = " + wb6Cfg.getDwellStr(0) print "Dwell 1 = " + str(wb6Cfg.getDwell(1)) print "Dwell 1 = " + wb6Cfg.getDwellStr(1) print "Dwell 2 = " + str(wb6Cfg.getDwell(2)) print "Dwell 2 = " + wb6Cfg.getDwellStr(2) print "Dwell 3 = " + str(wb6Cfg.getDwell(3)) print "Dwell 3 = " + wb6Cfg.getDwellStr(3) #print "Dwell 4 = " + str(wb6Cfg.getDwell(4)) #print "Dwell 4 = " + wb6Cfg.getDwellStr(4) print "Set Point 0 = " + str(wb6Cfg.getSetPoint(0)) print "Dig Out Name 0 = " + str(wb6Cfg.getDigOutName(0)) print "Analogue Out Name 0 = " + str(wb6Cfg.getAnalogueOutName(0))
def verifyDwellConfiguration(self): cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) self.assertEqual(cfg.getDwell(0), 30) self.assertEqual(cfg.getDwell(1), 2) self.assertEqual(cfg.getDwell(2), 60) self.assertEqual(cfg.getDwell(3), 3600)
def verifyName(self): cfg = wb6Config.wb6Config( self._wbAddress ) assert cfg.getNodeName() == "UnNamed", cfg.getNodeName() return
def verifySetPointConfiguration(self): cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) self.assertEqual( cfg.getSetPoint(0), 0) self.assertEqual( cfg.getSetPoint(1), 14) self.assertEqual( cfg.getSetPoint(2), 28) self.assertEqual( cfg.getSetPoint(3),42)
def verifyNodeNumber(self): cfg = wb6Config.wb6Config( self._wbAddress ) assert cfg.getNodeNumber() == 0, str(cfg.getNodeNumber()) return
def verifyDoNameConfiguration(self): cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) for idx in range(0,TestWbConfig._doCount): self.assertEqual( cfg.getDigOutName(idx),"DigOut-"+str(idx) )
def verifyFadeRate(self): cfg = wb6Config.wb6Config( self._wbAddress ) assert cfg.getFadeRate() == 8, str(cfg.getFadeRate()) return
def verifyAoNameConfiguration(self): cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) for idx in range(0,TestWbConfig._aoCount): self.assertEqual( cfg.getAnalogueOutName(idx), "AnOut-"+str(idx))
def verifyAnalogueIn(self): cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._aiCount): self.verifyAiConfiguration(idx, cfg)
def verifyTemperatures(self): cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._tempCount): self.verifyTempConfiguration(idx, cfg)
def verifyScenes(self): cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._sceneCount): self.verifySceneConfiguration(idx, cfg)
def verifyDigitalIn(self): cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._diCount): self.verifyDiConfiguration(idx, cfg)
def verifyDoNameConfiguration(self): cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) for idx in range(0, TestWbConfig._doCount): self.assertEqual(cfg.getDigOutName(idx), "DigOut-" + str(idx))
def verifyAnalogueIn(self): cfg = wb6Config.wb6Config(self._wbAddress) for idx in range(0, self._aiCount): self.verifyAiConfiguration(idx, cfg)
def verifyAoNameConfiguration(self): cfg = wb6Config.wb6Config( self._wbAddress ) for idx in range(0,self._aoCount): assert cfg.getAnalogueOutName(idx) == "AnOut-"+str(idx+1), cfg.getAnalogueOutName(idx)
import sys sys.path.append('../API') import wb6Config test_ip = "10.100.100.100" wb6Cfg = wb6Config.wb6Config(test_ip) print "Version = " + wb6Cfg.getVersion() print "NodeName = " + wb6Cfg.getNodeName() print "NodeNumber = " + str(wb6Cfg.getNodeNumber()) print "FadeRate = " + str(wb6Cfg.getFadeRate()) print "IpAddress = " + str(wb6Cfg.getIpAddress()) print "MAC Address = " + str(wb6Cfg.getMacAddress()) print "Rotary 0 = " + str(wb6Cfg.getRotary(0)) print "Dwell 0 = " + str(wb6Cfg.getDwell(0)) print "Dwell 0 = " + wb6Cfg.getDwellStr(0) print "Dwell 1 = " + str(wb6Cfg.getDwell(1)) print "Dwell 1 = " + wb6Cfg.getDwellStr(1) print "Dwell 2 = " + str(wb6Cfg.getDwell(2)) print "Dwell 2 = " + wb6Cfg.getDwellStr(2) print "Dwell 3 = " + str(wb6Cfg.getDwell(3)) print "Dwell 3 = " + wb6Cfg.getDwellStr(3) #print "Dwell 4 = " + str(wb6Cfg.getDwell(4)) #print "Dwell 4 = " + wb6Cfg.getDwellStr(4) print "Set Point 0 = " + str(wb6Cfg.getSetPoint(0)) print "Dig Out Name 0 = " + str(wb6Cfg.getDigOutName(0)) print "Analogue Out Name 0 = " + str(wb6Cfg.getAnalogueOutName(0))
def verifyFadeRate(self): cfg = wb6Config.wb6Config(self._wbAddress) assert cfg.getFadeRate() == 8, str(cfg.getFadeRate()) return
def verifyNodeNumber(self): cfg = wb6Config.wb6Config(self._wbAddress) assert cfg.getNodeNumber() == 0, str(cfg.getNodeNumber()) return
def verifySchedules(self): cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) for idx in range(0,TestWbConfig._schedCount): self.verifyScheduleConfiguration(idx, cfg)
def verifyDwellConfiguration(self): cfg = wb6Config.wb6Config( TestWbConfig._wbAddress ) self.assertEqual( cfg.getDwell(0),30) self.assertEqual( cfg.getDwell(1),2) self.assertEqual( cfg.getDwell(2),60) self.assertEqual( cfg.getDwell(3),3600)
def showMacAddress(self ): cfg = wb6Config(underTestAddress) print cfg.getMacAddress()
def verifySchedules(self): cfg = wb6Config.wb6Config(TestWbConfig._wbAddress) for idx in range(0, TestWbConfig._schedCount): self.verifyScheduleConfiguration(idx, cfg)