Skip to content

Commit

Permalink
fix(api): Fix RPC reporting wrong models for v1.3 pipettes (#1691)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous authored Jun 13, 2018
1 parent cad5e74 commit e302382
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
13 changes: 5 additions & 8 deletions api/opentrons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,15 @@ def _create_pipette_from_config(
return p

def _retrieve_version_number(self, mount, expected_model_substring):
# pass a default pipette model-version, for when robot is simulating
# this allows any pipette to be simulated, regardless of what is
# actually attached/cached on the robot's mounts
default_model = expected_model_substring + '_v1' # default to v1
if robot.is_simulating():
return default_model

attached_model = robot.get_attached_pipettes()[mount]['model']

if attached_model and expected_model_substring in attached_model:
return attached_model
else:
return default_model
# pass a default pipette model-version for when robot is simulating
# this allows any pipette to be simulated, regardless of what is
# actually attached/cached on the robot's mounts
return expected_model_substring + '_v1' # default to v1


instruments = InstrumentsWrapper(robot)
Expand Down
3 changes: 3 additions & 0 deletions api/opentrons/api/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def on_command(message):
unsubscribe = subscribe(types.COMMAND, on_command)

try:
# ensure actual pipettes are cached before driver is disconnected
robot.cache_instrument_models()

# TODO (artyom, 20171005): this will go away
# once robot / driver simulation flow is fixed
robot.disconnect()
Expand Down
1 change: 1 addition & 0 deletions api/tests/opentrons/api/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def labware_setup():
plates = \
[containers.load('96-PCR-flat', slot, slot) for slot in ['2', '5']]

# TODO(mc, 2018-06-13): use standard pipette factories
p100 = instruments.Pipette(
name='p100', mount='right', channels=8, tip_racks=tip_racks)

Expand Down

0 comments on commit e302382

Please sign in to comment.