Skip to content

Commit

Permalink
assert module state is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Jan 2, 2025
1 parent b2569ac commit 33c6dc9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/src/opentrons/protocol_engine/state/update_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ def set_fluid_empty(self: Self, pipette_id: str) -> Self:

def set_absorbance_reader_lid(self: Self, module_id: str, is_lid_on: bool) -> Self:
"""Update an absorbance reader's lid location. See `AbsorbanceReaderLidUpdate`."""
assert self.absorbance_reader_state_update == NO_CHANGE
self.absorbance_reader_state_update = AbsorbanceReaderStateUpdate(
module_id=module_id,
absorbance_reader_lid=AbsorbanceReaderLidUpdate(is_lid_on=is_lid_on),
Expand All @@ -613,6 +614,7 @@ def set_absorbance_reader_data(
self, module_id: str, read_result: typing.Dict[int, typing.Dict[str, float]]
) -> Self:
"""Update an absorbance reader's read data. See `AbsorbanceReaderReadDataUpdate`."""
assert self.absorbance_reader_state_update == NO_CHANGE
self.absorbance_reader_state_update = AbsorbanceReaderStateUpdate(
module_id=module_id,
absorbance_reader_data=AbsorbanceReaderDataUpdate(read_result=read_result),
Expand All @@ -627,6 +629,7 @@ def initialize_absorbance_reader(
reference_wave_length: typing.Optional[int],
) -> Self:
"""Initialize absorbance reader."""
assert self.absorbance_reader_state_update == NO_CHANGE
self.absorbance_reader_state_update = AbsorbanceReaderStateUpdate(
module_id=module_id,
initialize_absorbance_reader_update=AbsorbanceReaderInitializeUpdate(
Expand Down

0 comments on commit 33c6dc9

Please sign in to comment.