Skip to content

Commit f74853b

Browse files
authored
fix(app): open tc lid in LPC via protocol engine command (#11111)
Closes #11096
1 parent 00d338d commit f74853b

File tree

1 file changed

+8
-31
lines changed

1 file changed

+8
-31
lines changed

app/src/organisms/LabwarePositionCheck/hooks/useLabwarePositionCheck.ts

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as React from 'react'
2-
import { useDispatch } from 'react-redux'
32
import { useTranslation } from 'react-i18next'
43
import isEqual from 'lodash/isEqual'
54
import { getCommand } from '@opentrons/api-client'
@@ -8,24 +7,19 @@ import {
87
getLabwareDefIsStandard,
98
getLabwareDisplayName,
109
IDENTITY_VECTOR,
11-
THERMOCYCLER_MODULE_TYPE,
1210
} from '@opentrons/shared-data'
1311
import {
1412
useHost,
1513
useCreateLabwareDefinitionMutation,
1614
useCreateCommandMutation,
1715
} from '@opentrons/react-api-client'
1816
import { useTrackEvent } from '../../../redux/analytics'
19-
import { sendModuleCommand } from '../../../redux/modules'
2017
import {
2118
useCurrentRunId,
2219
useCurrentRunCommands,
2320
useCurrentProtocol,
2421
} from '../../ProtocolUpload/hooks'
25-
import {
26-
useAttachedModules,
27-
useProtocolDetailsForRun,
28-
} from '../../Devices/hooks'
22+
import { useProtocolDetailsForRun } from '../../Devices/hooks'
2923
import { getLabwareLocation } from '../../Devices/ProtocolRun/utils/getLabwareLocation'
3024
import { getModuleInitialLoadInfo } from '../../Devices/ProtocolRun/utils/getModuleInitialLoadInfo'
3125
import { useSteps } from './useSteps'
@@ -256,9 +250,6 @@ export function useLabwarePositionCheck(
256250
const host = useHost()
257251
const trackEvent = useTrackEvent()
258252
const LPCSteps = useSteps(currentRunId)
259-
const dispatch = useDispatch()
260-
const robotName = host?.robotName ?? ''
261-
const attachedModules = useAttachedModules()
262253

263254
const LPCCommands = LPCSteps.reduce<LabwarePositionCheckCreateCommand[]>(
264255
(commands, currentStep) => {
@@ -558,27 +549,13 @@ export function useLabwarePositionCheck(
558549

559550
// execute prep commands
560551
prepCommands.forEach(prepCommand => {
561-
// 11/18/21 intercept TCOpenLidCommand and use legacy modules endpoint
562-
// delete this once PE supports themocycler open lid command
563-
if (prepCommand.commandType === 'thermocycler/openLid') {
564-
const serial = attachedModules.find(
565-
module => module.moduleType === THERMOCYCLER_MODULE_TYPE
566-
)?.serialNumber
567-
if (serial == null) {
568-
throw new Error(
569-
'Expected to be able to find thermocycler serial number, but could not.'
570-
)
571-
}
572-
dispatch(sendModuleCommand(robotName, serial, 'open'))
573-
} else {
574-
createCommand({
575-
runId: currentRunId,
576-
command: createCommandData(prepCommand),
577-
}).catch((e: Error) => {
578-
console.error(`error issuing command to robot: ${e.message}`)
579-
setError(e)
580-
})
581-
}
552+
createCommand({
553+
runId: currentRunId,
554+
command: createCommandData(prepCommand),
555+
}).catch((e: Error) => {
556+
console.error(`error issuing command to robot: ${e.message}`)
557+
setError(e)
558+
})
582559
})
583560
// issue first movement command
584561
createCommand({

0 commit comments

Comments
 (0)