Skip to content

Commit

Permalink
set lower bound for pressure bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit Chaudhary committed Jun 9, 2024
1 parent 0a3f95a commit e17cbbb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/frontendCardSquare.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ def create_card(self):
card_icon.attach(level_obj.dw, 0, 1, 1, 1)

elif self.title.lower() == "pressure":
pressure_level = (self.curr_w.surface_pressure.get("data") - 872) / (1080 - 872)
level_obj = DrawLevelBar(
(self.curr_w.surface_pressure.get("data") - 872) / (1080 - 872),
max(pressure_level,0),
rounded_cap=True,
)
card_icon.attach(level_obj.dw, 0, 1, 1, 1)
Expand Down

0 comments on commit e17cbbb

Please sign in to comment.