Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add liquid state property #15553

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def __init__(
labware.Labware, TrashBin, WasteChute, None
] = trash
self.requested_as = requested_as
self._liquid_presence_state: Optional[types.LiquidPresenceState] = None

@property
@requires_version(2, 0)
Expand Down Expand Up @@ -1642,6 +1643,16 @@ def flow_rate(self) -> "FlowRates":
"""
return self._core.get_flow_rate()

@property
@requires_version(2, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.20, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep ty

def liquid_presence_state(self) -> Optional[types.LiquidPresenceState]:
return self._liquid_presence_state

@liquid_presence_state.setter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we want a public setter, or should this always be driven by sensor measurements?

@requires_version(2, 0)
def liquid_presence_state(self, state: types.LiquidPresenceState) -> None:
self._liquid_presence_state = state

@property
@requires_version(2, 0)
def type(self) -> str:
Expand Down
6 changes: 6 additions & 0 deletions api/src/opentrons/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ def string_to_mount(cls, mount: str) -> "Mount":
return cls.EXTENSION


class LiquidPresenceState(str, enum.Enum):
PRESENT = "present"
ABSENT = "absent"
UNKNOWN = "unknown"


class MountType(str, enum.Enum):
LEFT = "left"
RIGHT = "right"
Expand Down
Loading