def status(): ret_dict = {} for pump_name in PumpLibrary.keys(): pump = Pump(pump_name) ret_key = "%sPump" % pump.pump_name ret_dict[ret_key] = pump.status() return ret_dict
from pumps.prototype import Pump from sys import argv import logging log_loc = "/home/pi/Documents/Aquarium/aquarium/pumps.log" logging.basicConfig(filename=log_loc, level=logging.INFO, format="%(asctime)s %(message)s") if __name__ == "__main__": script, pump_key = argv pump = Pump(pump_key) pump.dose_hourly()
from pumps.prototype import Pump from sys import argv import logging log_loc = "/home/pi/Documents/Aquarium/aquarium/pumps.log" logging.basicConfig(filename=log_loc, level=logging.INFO, format="%(asctime)s %(message)s") if __name__ == "__main__": script, pump_key, pump_mins = argv pump = Pump(pump_key) pump.dose_mins(float(pump_mins))
from pumps.prototype import Pump from pumps.config import PumpLibrary import logging log_loc = "/home/pi/Documents/Aquarium/aquarium/pumps.log" logging.basicConfig(filename=log_loc, level=logging.INFO, format="%(asctime)s %(message)s") for pump_name in PumpLibrary.keys(): pump = Pump(pump_name) pump.off()
from pumps.prototype import Pump from pumps.config import PumpLibrary import logging log_loc = "/home/pi/Documents/Aquarium/aquarium/pumps.log" logging.basicConfig(filename=log_loc, level=logging.INFO, format="%(asctime)s %(message)s") for pump_name in PumpLibrary.keys(): pump = Pump(pump_name) pump.on()