From 6b750d18131d365802859ecb3e9d1639f934e620 Mon Sep 17 00:00:00 2001 From: Ryan Lewis Date: Tue, 10 Oct 2023 11:50:48 -0500 Subject: [PATCH] Fix: reset state on reconnect --- scripts/ot2_rest_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ot2_rest_client.py b/scripts/ot2_rest_client.py index 169a57d..a851beb 100644 --- a/scripts/ot2_rest_client.py +++ b/scripts/ot2_rest_client.py @@ -62,6 +62,7 @@ def connect_robot(): try: print(ip) ot2 = OT2_Driver(OT2_Config(ip=ip)) + state = "IDLE" except ConnectTimeoutError as connection_err: state = "ERROR" @@ -219,7 +220,6 @@ async def lifespan(app: FastAPI): check_resources_folder() check_protocols_folder() connect_robot() - state = "IDLE" yield pass