Skip to content

Commit ea3c122

Browse files
allow good inputs to stay the same
1 parent 947e3e9 commit ea3c122

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

api/src/opentrons/protocol_engine/types/liquid_level_detection.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,19 @@ class WellInfoSummary(BaseModel):
107107
@field_validator("probed_height", "probed_volume", mode="before")
108108
@classmethod
109109
def validate_simulated_probe_result(
110-
cls, input_val: str | None
110+
cls, input_val: str | LiquidTrackingType | None
111111
) -> LiquidTrackingType | None:
112112
"""Return the appropriate input to WellInfoSummary from json data."""
113113
if not input_val:
114114
return None
115-
if input_val.isdigit():
116-
return float(input_val)
117-
else:
118-
return SimulatedProbeResult()
115+
if isinstance(input_val, LiquidTrackingType):
116+
return input_val
117+
if isinstance(input_val, str):
118+
if input_val.isdigit():
119+
return float(input_val)
120+
elif input_val == "SimulatedProbeResult":
121+
return SimulatedProbeResult()
122+
return None
119123

120124
labware_id: str
121125
well_name: str

0 commit comments

Comments
 (0)