Skip to content

Commit

Permalink
#68 Add method to fetch water level from claire state
Browse files Browse the repository at this point in the history
  • Loading branch information
magoorden committed Aug 28, 2024
1 parent 5a227e7 commit 9d53bee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions py_driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ def tube1_level(self) -> Optional[float]:
def tube2_level(self) -> Optional[float]:
return self.convert_distance_to_level(self.Tube2_sonar_dist_mm)

def get_tube_level(self, tube):
if tube == 1:
return self.tube1_level
if tube == 2:
return self.tube2_level
else:
raise RuntimeError(f"Unexpected tube number {tube}.")


class ClaireDevice:
"""
Expand Down

0 comments on commit 9d53bee

Please sign in to comment.