File tree 3 files changed +12
-9
lines changed
api/src/opentrons/legacy_commands
3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def broker(self, broker: LegacyBroker) -> None:
31
31
"""Set the publisher's Broker."""
32
32
self ._broker = broker
33
33
34
-
34
+ c
35
35
CommandPayloadCreator = Callable [..., CommandPayload ]
36
36
"""A function that creates a Command dictionary message."""
37
37
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ describe('consolidate single-channel', () => {
140
140
name : 'wasteChute' ,
141
141
id : 'wasteChuteId' ,
142
142
location : 'cutoutD3' ,
143
+ pythonName : 'mock_waste_chute' ,
143
144
} ,
144
145
} ,
145
146
}
@@ -618,6 +619,7 @@ describe('consolidate single-channel', () => {
618
619
name : 'trashBin' ,
619
620
id : 'trashBinId' ,
620
621
location : 'cutoutA3' ,
622
+ pythonName : 'mock_trash_bin' ,
621
623
} ,
622
624
} ,
623
625
}
@@ -1156,6 +1158,7 @@ describe('consolidate single-channel', () => {
1156
1158
name : 'trashBin' ,
1157
1159
id : 'trashBinId' ,
1158
1160
location : 'cutoutA3' ,
1161
+ pythonName : 'mock_trash_bin' ,
1159
1162
} ,
1160
1163
} ,
1161
1164
}
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import type {
30
30
CommandCreator ,
31
31
CommandCreatorError ,
32
32
CommandCreatorWarning ,
33
+ TrashBinEntity ,
33
34
} from '../../types'
34
35
35
36
/** Move labware from one location to another, manually or via a gripper. */
@@ -270,18 +271,17 @@ export const moveLabware: CommandCreator<MoveLabwareParams> = (
270
271
const matchingTrashCutoutId = trashCutoutIds . find (
271
272
cutoutId => cutoutId === cutoutIdFromAddressableAreaName
272
273
)
273
- const matchingTrashId =
274
- matchingTrashCutoutId != null
275
- ? Object . values ( additionalEquipmentEntities ) . find (
276
- ae =>
277
- ae . name === 'trashBin' && ae . location === matchingTrashCutoutId
278
- ) ?. id
279
- : null
274
+ const matchingTrashBinEntity : TrashBinEntity | undefined = Object . values (
275
+ additionalEquipmentEntities
276
+ ) . find (
277
+ ae => ae . name === 'trashBin' && ae . location === matchingTrashCutoutId
278
+ )
279
+ const matchingTrashId = matchingTrashBinEntity ?. id
280
280
281
281
if ( is4thColumnSlot ) {
282
282
location = formatPyStr ( newLocation . addressableAreaName )
283
283
} else if ( matchingTrashId != null && ! isWasteChuteLocation ) {
284
- location = additionalEquipmentEntities [ matchingTrashId ] ?. pythonName ?? ''
284
+ location = matchingTrashBinEntity ?. pythonName ?? ''
285
285
} else if ( matchingTrashId == null && isWasteChuteLocation ) {
286
286
location =
287
287
Object . values ( additionalEquipmentEntities ) . find (
You can’t perform that action at this time.
0 commit comments