From e5bd448f609ef57c22bcaf9051edf3bd298b49c3 Mon Sep 17 00:00:00 2001 From: Ryan howard Date: Fri, 22 Nov 2024 14:53:23 -0500 Subject: [PATCH] use engine state instead of hardware api to detect pressure sensor support --- api/src/opentrons/protocol_api/core/engine/instrument.py | 7 ++----- api/src/opentrons/protocol_engine/state/pipettes.py | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/api/src/opentrons/protocol_api/core/engine/instrument.py b/api/src/opentrons/protocol_api/core/engine/instrument.py index 8e27b5e54ae..8fc707541f0 100644 --- a/api/src/opentrons/protocol_api/core/engine/instrument.py +++ b/api/src/opentrons/protocol_api/core/engine/instrument.py @@ -870,12 +870,9 @@ def retract(self) -> None: self._engine_client.execute_command(cmd.HomeParams(axes=[z_axis])) def _pressure_supported_by_pipette(self) -> bool: - supported = self._sync_hardware_api.get_pressure_sensor_available( - mount=self.get_mount() + return self._engine_client.state.pipettes.get_pipette_supports_pressure( + self.pipette_id ) - if not isinstance(supported, bool): - return False - return supported def detect_liquid_presence(self, well_core: WellCore, loc: Location) -> bool: labware_id = well_core.labware_id diff --git a/api/src/opentrons/protocol_engine/state/pipettes.py b/api/src/opentrons/protocol_engine/state/pipettes.py index c345199d92a..6418f50ee90 100644 --- a/api/src/opentrons/protocol_engine/state/pipettes.py +++ b/api/src/opentrons/protocol_engine/state/pipettes.py @@ -763,6 +763,13 @@ def get_pipette_bounds_at_specified_move_to_position( pip_front_left_bound, ) + def get_pipette_supports_pressure(self, pipette_id: str) -> bool: + """Return if this pipette supports a pressure sensor.""" + return ( + "pressure" + in self._state.static_config_by_id[pipette_id].available_sensors.sensors + ) + def get_liquid_presence_detection(self, pipette_id: str) -> bool: """Determine if liquid presence detection is enabled for this pipette.""" try: