Skip to content

Commit d297962

Browse files
authored
refactor(protocol-timer): do not log warnings for no-duration commands
1 parent 1c63289 commit d297962

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

api/src/opentrons/protocols/duration/estimator.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def on_message(self, message: types.CommandMessage) -> None:
8989
payload = message["payload"]
9090

9191
# We cannot handle paired pipette messages
92-
if "instruments" in payload or "locations" in payload:
92+
# locations also applies to transfer commands
93+
if "instruments" in payload:
9394
logger.warning(
9495
f"Paired pipettes are not supported by the duration estimator. "
9596
f"Command '{payload['text']}' cannot be estimated properly."
@@ -164,6 +165,15 @@ def handle_message( # noqa: C901
164165
duration = self.on_thermocycler_deactivate_lid(payload=payload)
165166
elif message_name == types.THERMOCYCLER_OPEN:
166167
duration = self.on_thermocycler_lid_open(payload=payload)
168+
elif message_name == types.TRANSFER:
169+
# Already accounted for in other steps
170+
pass
171+
elif message_name == types.DISTRIBUTE:
172+
pass
173+
elif message_name == types.CONSOLIDATE:
174+
pass
175+
elif message_name == types.COMMENT:
176+
pass
167177
else:
168178
logger.warning(
169179
f"Command type '{message_name}' is not yet supported by the "
@@ -291,7 +301,6 @@ def on_blow_out(self, payload) -> float:
291301
# So we are defaulting to 0.5 seconds
292302
duration = 0.5
293303
logger.info(f"blowing_out_for {duration} seconds, in slot {curr_slot}")
294-
295304
return duration
296305

297306
def on_touch_tip(self, payload) -> float:
@@ -304,7 +313,6 @@ def on_touch_tip(self, payload) -> float:
304313
# depth = plate['A1'].diameter
305314
duration = 0.5
306315
logger.info(f"touch_tip for {duration} seconds")
307-
308316
return duration
309317

310318
def on_delay(self, payload) -> float:
@@ -394,23 +402,20 @@ def on_thermocycler_lid_close(self, payload) -> float:
394402
duration = 24
395403
thermoaction = "closing"
396404
logger.info(f"thermocation = {thermoaction}")
397-
398405
return duration
399406

400407
def on_thermocycler_lid_open(self, payload) -> float:
401408
# Hardware said ~24 seconds
402409
duration = 24
403410
thermoaction = "opening"
404411
logger.info(f"thermocation = {thermoaction}")
405-
406412
return duration
407413

408414
def on_thermocycler_deactivate_lid(self, payload) -> float:
409415
# Hardware said ~23 seconds
410416
duration = 23
411417
thermoaction = "Deactivating"
412418
logger.info(f"thermocation = {thermoaction}")
413-
414419
return duration
415420

416421
def on_tempdeck_set_temp(self, payload) -> float:

0 commit comments

Comments
 (0)