diff --git a/api/docs/v2/conf.py b/api/docs/v2/conf.py index 1913abbfe1a..2df80abb5d2 100644 --- a/api/docs/v2/conf.py +++ b/api/docs/v2/conf.py @@ -445,7 +445,7 @@ ("py:class", r".*protocol_api\.config.*"), ("py:class", r".*opentrons_shared_data.*"), ("py:class", r".*protocol_api._parameters.Parameters.*"), - ("py:class", r".*AbsorbanceReaderContext"), # shh it's a secret (for now) + ("py:class", r".*AbsorbanceReaderContext"), ("py:class", r".*RobotContext"), # shh it's a secret (for now) ("py:class", r'.*AbstractLabware|APIVersion|LabwareLike|LoadedCoreMap|ModuleTypes|NoneType|OffDeckType|ProtocolCore|WellCore'), # laundry list of not fully qualified things ] diff --git a/api/src/opentrons/protocol_engine/commands/absorbance_reader/close_lid.py b/api/src/opentrons/protocol_engine/commands/absorbance_reader/close_lid.py index 6b088aa95fa..207707778b6 100644 --- a/api/src/opentrons/protocol_engine/commands/absorbance_reader/close_lid.py +++ b/api/src/opentrons/protocol_engine/commands/absorbance_reader/close_lid.py @@ -59,17 +59,30 @@ async def execute( mod_substate = self._state_view.modules.get_absorbance_reader_substate( module_id=params.moduleId ) - # Make sure the lid is open - mod_substate.raise_if_lid_status_not_expected(lid_on_expected=False) - # Allow propagation of ModuleNotAttachedError. - _ = self._equipment.get_module_hardware_api(mod_substate.module_id) - - # lid should currently be docked + # lid should currently be on the module assert mod_substate.lid_id is not None loaded_lid = self._state_view.labware.get(mod_substate.lid_id) assert labware_validation.is_absorbance_reader_lid(loaded_lid.loadName) + # If the lid is already Closed, No-op out + if mod_substate.is_lid_on: + current_offset_id = self._equipment.find_applicable_labware_offset_id( + labware_definition_uri=loaded_lid.definitionUri, + labware_location=loaded_lid.location, + ) + return SuccessData( + public=CloseLidResult( + lidId=loaded_lid.id, + newLocation=loaded_lid.location, + offsetId=current_offset_id, + ), + private=None, + ) + + # Allow propagation of ModuleNotAttachedError. + _ = self._equipment.get_module_hardware_api(mod_substate.module_id) + current_location = loaded_lid.location validated_current_location = ( self._state_view.geometry.ensure_valid_gripper_location(current_location) diff --git a/api/src/opentrons/protocol_engine/commands/absorbance_reader/open_lid.py b/api/src/opentrons/protocol_engine/commands/absorbance_reader/open_lid.py index 1de8ab1f077..cef90051f9c 100644 --- a/api/src/opentrons/protocol_engine/commands/absorbance_reader/open_lid.py +++ b/api/src/opentrons/protocol_engine/commands/absorbance_reader/open_lid.py @@ -54,17 +54,29 @@ async def execute(self, params: OpenLidParams) -> SuccessData[OpenLidResult, Non mod_substate = self._state_view.modules.get_absorbance_reader_substate( module_id=params.moduleId ) - # Make sure the lid is closed - mod_substate.raise_if_lid_status_not_expected(lid_on_expected=True) - - # Allow propagation of ModuleNotAttachedError. - _ = self._equipment.get_module_hardware_api(mod_substate.module_id) - # lid should currently be on the module assert mod_substate.lid_id is not None loaded_lid = self._state_view.labware.get(mod_substate.lid_id) assert labware_validation.is_absorbance_reader_lid(loaded_lid.loadName) + # If the lid is already Open, No-op out + if not mod_substate.is_lid_on: + current_offset_id = self._equipment.find_applicable_labware_offset_id( + labware_definition_uri=loaded_lid.definitionUri, + labware_location=loaded_lid.location, + ) + return SuccessData( + public=OpenLidResult( + lidId=loaded_lid.id, + newLocation=loaded_lid.location, + offsetId=current_offset_id, + ), + private=None, + ) + + # Allow propagation of ModuleNotAttachedError. + _ = self._equipment.get_module_hardware_api(mod_substate.module_id) + current_location = loaded_lid.location validated_current_location = ( self._state_view.geometry.ensure_valid_gripper_location(current_location)