diff --git a/api/src/opentrons/protocol_engine/state/labware.py b/api/src/opentrons/protocol_engine/state/labware.py index ae1bb2fa8c0..29029ad0841 100644 --- a/api/src/opentrons/protocol_engine/state/labware.py +++ b/api/src/opentrons/protocol_engine/state/labware.py @@ -265,10 +265,7 @@ def _set_labware_location(self, action: Action) -> None: if new_offset_id != update_types.NO_CHANGE: self._state.labware_by_id[labware_id].offsetId = new_offset_id - if ( - action.state_update.labware_location.new_location - != update_types.NO_CHANGE - ): + if action.state_update.labware_location.new_location: new_location = action.state_update.labware_location.new_location if isinstance( @@ -279,8 +276,6 @@ def _set_labware_location(self, action: Action) -> None: # If a labware has been moved into a waste chute it's been chuted away and is now technically off deck new_location = OFF_DECK_LOCATION - assert new_location != update_types.NO_CHANGE - self._state.labware_by_id[labware_id].location = new_location diff --git a/api/src/opentrons/protocol_engine/state/update_types.py b/api/src/opentrons/protocol_engine/state/update_types.py index 4645fe7e461..e319149f015 100644 --- a/api/src/opentrons/protocol_engine/state/update_types.py +++ b/api/src/opentrons/protocol_engine/state/update_types.py @@ -82,7 +82,7 @@ class LabwareLocationUpdate: labware_id: str - new_location: LabwareLocation | None | NoChangeType + new_location: LabwareLocation | None """The labware's new logical location. Note: `new_location=None` means "change the location to `None` (unknown)", @@ -168,23 +168,14 @@ def set_labware_location( # noqa: D102 self, *, labware_id: str, - new_location: LabwareLocation | None | NoChangeType = NO_CHANGE, - new_offset_id: str | None | NoChangeType = NO_CHANGE, + new_location: LabwareLocation, + new_offset_id: str | None, ) -> None: - if new_location != NO_CHANGE: - self.labware_location = LabwareLocationUpdate( - labware_id=labware_id, - new_location=new_location, - offset_id=new_offset_id, - ) - else: - assert new_offset_id != NO_CHANGE - - self.labware_location = LabwareLocationUpdate( - labware_id=labware_id, - offset_id=new_offset_id, - new_location=_NoChangeEnum.NO_CHANGE, - ) + self.labware_location = LabwareLocationUpdate( + labware_id=labware_id, + new_location=new_location, + offset_id=new_offset_id, + ) def set_loaded_labware( self,