Index: tests/test_uv_reactors.py =================================================================== diff -u -r56f06b55eb8ab96bd69d12eb9d9d5c71241755ad -r2e961b0daeddacde19f8a16718ed5eea3bd383f0 --- tests/test_uv_reactors.py (.../test_uv_reactors.py) (revision 56f06b55eb8ab96bd69d12eb9d9d5c71241755ad) +++ tests/test_uv_reactors.py (.../test_uv_reactors.py) (revision 2e961b0daeddacde19f8a16718ed5eea3bd383f0) @@ -2,16 +2,32 @@ import sys sys.path.append("..") from dialin.dg.dialysate_generator import DG -from dialin.dg.uv_reactors import ReactorsStates +from dialin.dg.uv_reactors import ReactorsStates, ReactorsHealthStatus, ReactorsNames from time import sleep dg = DG(log_level='DEBUG') dg.cmd_log_in_to_dg() sleep(1) -dg.uv_reactors.cmd_start_stop_inlet_uv_reactor(state=ReactorsStates.UV_REACTOR_STATE_ON.name) +#dg.uv_reactors.cmd_start_stop_inlet_uv_reactor(ReactorsStates.UV_REACTOR_STATE_ON.value) +dg.uv_reactors.cmd_start_stop_outlet_uv_reactor(ReactorsStates.UV_REACTOR_STATE_ON.value) +#dg.uv_reactors.cmd_uv_reactors_health_override(ReactorsNames.INLET_UV_REACTOR.value, +# ReactorsHealthStatus.UV_REACTOR_NOT_HEALTHY.value, reset=1) + while True: + try: + sleep(1) + print('Inlet_health, {}, Inlet_state, {}, Outlet_health, {}, Outlet_health, {}'. + format(dg.uv_reactors.inlet_uv_reactor_state, + ReactorsHealthStatus(dg.uv_reactors.inlet_uv_reactor_health).name, + dg.uv_reactors.outlet_uv_reactor_state, + ReactorsHealthStatus(dg.uv_reactors.outlet_uv_reactor_health).name)) - sleep(1) - print(dg.uv_reactors.inlet_uv_reactor_state, dg.uv_reactors.inlet_uv_reactor_health) + except KeyboardInterrupt: + dg.uv_reactors.cmd_start_stop_inlet_uv_reactor(ReactorsStates.UV_REACTOR_STATE_OFF.name) + dg.uv_reactors.cmd_start_stop_outlet_uv_reactor(ReactorsStates.UV_REACTOR_STATE_OFF.name) + dg.uv_reactors.cmd_uv_reactors_health_override(ReactorsNames.OUTLET_UV_REACTOR.value, + ReactorsHealthStatus.UV_REACTOR_NOT_HEALTHY.value, reset=1) + break +