Skip to content

Commit

Permalink
make sure we recache & reconfigure instrument after a firmware update
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Feb 15, 2024
1 parent 23146ba commit 69ec3cd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def estop_cb(event: HardwareEvent) -> None:
self._pipette_handler = OT3PipetteHandler({m: None for m in OT3Mount})
self._gripper_handler = GripperHandler(gripper=None)
self._gantry_load = GantryLoad.LOW_THROUGHPUT
self._configured_since_update = True
OT3RobotCalibrationProvider.__init__(self, self._config)
ExecutionManagerProvider.__init__(self, isinstance(backend, OT3Simulator))

Expand Down Expand Up @@ -523,6 +524,7 @@ async def update_firmware(
message="Update failed because of uncaught error",
wrapping=[PythonException(e)],
) from e
self._configured_since_update = False

# Incidentals (i.e. not motion) API

Expand Down Expand Up @@ -651,8 +653,8 @@ async def cache_instruments(
and set up hardware controller internal state if necessary.
"""
skip_configure = await self._cache_instruments(require)
if not skip_configure:
self._log.info("Instrument model cache updated, reconfiguring")
if not skip_configure or not self._configured_since_update:
self._log.info("Reconfiguring instrument cache")
await self._configure_instruments()

async def _cache_instruments( # noqa: C901
Expand Down Expand Up @@ -725,6 +727,7 @@ async def _configure_instruments(self) -> None:
await self.set_gantry_load(self._gantry_load_from_instruments())
await self.refresh_positions()
await self.reset_tip_detectors(False)
self._configured_since_update = False

async def reset_tip_detectors(
self,
Expand Down

0 comments on commit 69ec3cd

Please sign in to comment.