|
5 | 5 | import enum
|
6 | 6 | from dataclasses import dataclass
|
7 | 7 | from datetime import datetime
|
8 |
| -from typing import Dict, List, Optional, Union |
| 8 | +from typing import Dict, List, Optional, Union, Tuple |
9 | 9 | from typing_extensions import assert_never
|
10 | 10 |
|
11 | 11 | from opentrons_shared_data.errors import EnumeratedError, ErrorCodes, PythonException
|
|
21 | 21 | from opentrons.protocol_engine.commands.unsafe.unsafe_ungrip_labware import (
|
22 | 22 | UnsafeUngripLabwareCommandType,
|
23 | 23 | )
|
| 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 | +) |
24 | 30 | from opentrons.protocol_engine.error_recovery_policy import (
|
25 | 31 | ErrorRecoveryPolicy,
|
26 | 32 | ErrorRecoveryType,
|
@@ -1137,8 +1143,16 @@ def _may_run_with_door_open(
|
1137 | 1143 | # is probably a mistake in the caller's logic.
|
1138 | 1144 | assert fixit_command.intent == CommandIntent.FIXIT
|
1139 | 1145 |
|
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 | + ) |
1142 | 1156 | # todo(mm, 2024-10-04): Instead of allowlisting command types, maybe we should
|
1143 | 1157 | # 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