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()
def stop_flow(): """ Blocks flow. Feedback is handled by heartbeats. """ app.logger.debug("Stopping flow.") tamagotchip.stop_flow() return 'OK'