Skip to content

Commit

Permalink
use engine state instead of hardware api to detect pressure sensor su…
Browse files Browse the repository at this point in the history
…pport
  • Loading branch information
ryanthecoder committed Nov 22, 2024
1 parent 0afbfeb commit e5bd448
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 2 additions & 5 deletions api/src/opentrons/protocol_api/core/engine/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions api/src/opentrons/protocol_engine/state/pipettes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e5bd448

Please sign in to comment.