Skip to content

Commit 001f1ff

Browse files
committed
add open/close latch as executable command during door open in CommandView
1 parent 3bcffa9 commit 001f1ff

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

api/src/opentrons/protocol_engine/state/commands.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import enum
66
from dataclasses import dataclass
77
from datetime import datetime
8-
from typing import Dict, List, Optional, Union
8+
from typing import Dict, List, Optional, Union, Tuple
99
from typing_extensions import assert_never
1010

1111
from opentrons_shared_data.errors import EnumeratedError, ErrorCodes, PythonException
@@ -21,6 +21,12 @@
2121
from opentrons.protocol_engine.commands.unsafe.unsafe_ungrip_labware import (
2222
UnsafeUngripLabwareCommandType,
2323
)
24+
from opentrons.protocol_engine.commands.unsafe.unsafe_stacker_close_latch import (
25+
UnsafeFlexStackerCloseLatchCommandType,
26+
)
27+
from opentrons.protocol_engine.commands.unsafe.unsafe_stacker_open_latch import (
28+
UnsafeFlexStackerOpenLatchCommandType,
29+
)
2430
from opentrons.protocol_engine.error_recovery_policy import (
2531
ErrorRecoveryPolicy,
2632
ErrorRecoveryType,
@@ -1137,8 +1143,16 @@ def _may_run_with_door_open(
11371143
# is probably a mistake in the caller's logic.
11381144
assert fixit_command.intent == CommandIntent.FIXIT
11391145

1140-
# This type annotation is to make sure the string constant stays in sync and isn't typo'd.
1141-
required_command_type: UnsafeUngripLabwareCommandType = "unsafe/ungripLabware"
1146+
# These type annotations are to make sure the string constants stay in sync and aren't typo'd.
1147+
allowed_command_types: Tuple[
1148+
UnsafeUngripLabwareCommandType,
1149+
UnsafeFlexStackerCloseLatchCommandType,
1150+
UnsafeFlexStackerOpenLatchCommandType,
1151+
] = (
1152+
"unsafe/ungripLabware",
1153+
"unsafe/flexStacker/closeLatch",
1154+
"unsafe/flexStacker/openLatch",
1155+
)
11421156
# todo(mm, 2024-10-04): Instead of allowlisting command types, maybe we should
11431157
# add a `mayRunWithDoorOpen: bool` field to command requests.
1144-
return fixit_command.commandType == required_command_type
1158+
return fixit_command.commandType in allowed_command_types

0 commit comments

Comments
 (0)