Ejemplo n.º 1
0
def standby_hardware():
    """ Closes all valves if no commands have been issued for the last X
    seconds. Intended to be run every now and then by the scheduler. 
    
    Adjust X seconds with the app.time_to_standby variable. """

    if (time.time() - float(r.get("last_hardware_access")))  \
                 > app.time_to_standby:
        tamagotchip.stop_flow()
Ejemplo n.º 2
0
def stop_flow():
    """ Blocks flow. Feedback is handled by heartbeats. """
    app.logger.debug("Stopping flow.")
    tamagotchip.stop_flow()
    return 'OK'