Skip to content

Commit

Permalink
Merge pull request #64 from DEIS-Tools/59-python-inconsistent-return-…
Browse files Browse the repository at this point in the history
…values-for-update_state

#59 Always return state, or raise exception
  • Loading branch information
magoorden authored Aug 28, 2024
2 parents 7e03275 + 97026e4 commit 883a013
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py_driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ def update_state(self, tube=None, quick=False, initial=False):
state["Tube1_sonar_dist_mm"] = round(ClaireState.convert_distance_to_level(state["Tube1_sonar_dist_mm"]), 1)
state["Tube2_sonar_dist_mm"] = round(ClaireState.convert_distance_to_level(state["Tube2_sonar_dist_mm"]), 1)
self.state = ClaireState(state)
return True
return False
return self.state
raise SensorError(f"Failed to retrieve new state, got {state}.")

def _underflow_check(self):
TAG = "UNDERFLOW_CHECK"
Expand Down

0 comments on commit 883a013

Please sign in to comment.