Пример #1
0
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
Пример #2
0
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()