def run(self): while True: tier.check_light_button() if __name__ == '__main__': num_tiers = 1 water = 1 assert len( sys.argv ), "Need 2 arguments. Arg 1: Number of tiers, must be int < 5. Arg 2: Water or not, 1 or 0" assert int(sys.argv[1]) <= 5, "Arg 1: Number of tiers, must be int < 5" # assert int(sys.argv[2]) == 1 or int(sys.argv[2]) == 0, "Arg 2: Water or not, 1 or 0" num_tiers, water = int(sys.argv[1]), int(sys.argv[2]) pin_setup.setup_gpios(num_tiers) if water: # pin_setup.setup_valve() # pin_setup.setup_reservoir() pass tiers = [None for x in range(num_tiers)] for i in range(num_tiers): # tiers[i] = Tier('pi6.'+str(i+1),pin_setup.DHT_PINS[i],light=pin_setup.light_pwm[i],fan=pin_setup.fan_pwm[i],heat=pin_setup.heat_pwm[i],exhaust=pin_setup.exhaust_pwm[i]) tiers[i] = Tier('pi5', pin_setup.DHT_PIN, light=pin_setup.dict[pin_setup.LED_HIGH], fan=pin_setup.dict[pin_setup.INTAKE_FAN], heat=pin_setup.dict[pin_setup.HEAT_PIN], exhaust=pin_setup.dict[pin_setup.EXHAUST_FAN], circ=pin_setup.dict[pin_setup.RE_FAN],
def run(self): while True: tier.check_light_button() if __name__ == '__main__': num_tiers = 1 water = 1 assert len( sys.argv ), "Need 2 arguments. Arg 1: Number of tiers, must be int < 5. Arg 2: Water or not, 1 or 0" assert int(sys.argv[1]) <= 5, "Arg 1: Number of tiers, must be int < 5" # assert int(sys.argv[2]) == 1 or int(sys.argv[2]) == 0, "Arg 2: Water or not, 1 or 0" num_tiers, water = int(sys.argv[1]), int(sys.argv[2]) pin_map = pin_setup.setup_gpios(num_tiers) if water: # pin_setup.setup_valve() # pin_setup.setup_reservoir() pass tiers = [None for x in range(num_tiers)] for i in range(num_tiers): tiers[i] = Tier(thingName, pin_setup.DHT_PIN, light=pin_map['led_high'], fan=pin_map['intake_fan'], heat=pin_map['heat_pin'], exhaust=pin_map['exhaust_fan'], circ=pin_map['re_fan'], tray_out=pin_map['tray_out'],