Skip to content

Commit

Permalink
setter instead of direct set
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Sep 20, 2024
1 parent 880973f commit d4c06ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ async def execute(
)

state_update = StateUpdate()
state_update.lid_status = BaseLabwareData(
id=loaded_lid.id, new_location=new_location, offset_id=new_offset_id
state_update.set_lid_status(
labware_id=loaded_lid.id, location=new_location, offset_id=new_offset_id
)

return SuccessData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ async def execute(self, params: OpenLidParams) -> SuccessData[OpenLidResult, Non
labware_location=new_location,
)

state_update.lid_status = BaseLabwareData(
id=loaded_lid.id, new_location=new_location, offset_id=new_offset_id
state_update.set_lid_status(
labware_id=loaded_lid.id, location=new_location, offset_id=new_offset_id
)

return SuccessData(
Expand Down
10 changes: 10 additions & 0 deletions api/src/opentrons/protocol_engine/state/update_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ def set_reloaded_labware(
id=labware_id, new_location=location, offset_id=offset_id
)

def set_lid_status(
self,
location: LabwareLocation,
labware_id: str,
offset_id: typing.Optional[str],
) -> None:
self.lid_status = BaseLabwareData(
id=labware_id, new_location=location, offset_id=offset_id
)

def clear_all_pipette_locations(self) -> None:
"""Mark all pipettes as having an unknown location."""
self.pipette_location = CLEAR

0 comments on commit d4c06ce

Please sign in to comment.