def simpleCtrl(): """ Very simple controller for testingt """ ctrl1 = ctrl.controllerList() ctrl1.addController("genctrl", appliances.genctrl()) return ctrl1
def mediumCtrl(): """Instantiate a list of several controllers""" ctrl1 = ctrl.controllerList() ctrl1.addController('genctrl', appliances.genctrl()) ctrl1.addController('timer', appliances.hoptimer()) ctrl1.addController('pump', appliances.hwPump()) ctrl1.addController('circulationPump', appliances.circulationPump()) ctrl1.addController('heater', appliances.hotWaterTun.hwt()) ctrl1.addController('boiler', appliances.boiler()) return(ctrl1)
def mediumCtrl(): """Instantiate a list of several controllers""" ctrl1 = ctrl.controllerList() ctrl1.addController("genctrl", appliances.genctrl()) ctrl1.addController("timer", appliances.hoptimer()) ctrl1.addController("hotWaterPump", appliances.hwPump()) ctrl1.addController("circulationPump", appliances.circulationPump()) ctrl1.addController("wortPump", appliances.wortPump()) ctrl1.addController("waterHeater", appliances.hotWaterTun.hwt()) ctrl1.addController("boiler", appliances.boiler()) return ctrl1
def simpleCtrl(): ctrl1 = ctrl.controllerList() ctrl1.addController('genctrl', appliances.genctrl()) return(ctrl1)
def testGenSensor(): c1 = appliances.genctrl() assert isinstance(c1.sensor.getID(), str) assert (isinstance(c1.sensor.getValue(), int) or isinstance(c1.sensor.getValue(), float))
import appliances import ctrl def testGenSensor(): c1 = appliances.genctrl() assert isinstance(c1.sensor.getID(), str) assert (isinstance(c1.sensor.getValue(), int) or isinstance(c1.sensor.getValue(), float)) def testSensors(): clist = ctrl.controllerList() clist.load() for key, c1 in clist.items(): print "Checking sensor", key assert isinstance(c1.sensor.getID(), str) assert (isinstance(c1.sensor.getValue(), int) or isinstance(c1.sensor.getValue(), float)) if __name__ == "__main__": c1 = appliances.genctrl() print c1.sensor.getID() testGenSensor() testSensors() if isinstance(c1.sensor.getID(), str): print "ID OK" else: print "ID FAIL"