Skip to content

Commit

Permalink
Update pisugarx.py
Browse files Browse the repository at this point in the history
limits % to  no deci dunno how i missed this lol

Signed-off-by: LH <[email protected]>
  • Loading branch information
renewedbullet authored Dec 22, 2024
1 parent 868314e commit de7e9b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pwnagotchi/plugins/default/pisugarx.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ def on_ui_update(self, ui):
if self.drot == 0: # show battery voltage
ui.set('bat', f"{voltage:.2f}V")
elif self.drot == 1: # show battery capacity
ui.set('bat', f"{capacity:.2f}%")
ui.set('bat', f"{capacity:.0f}%")
else: # show battery temperature
ui.set('bat', f"{temp}°C")
else:
# Rotation disabled, show only the selected default display
if self.default_display == 'voltage':
ui.set('bat', f"{voltage:.2f}V")
elif self.default_display in ['percentage', 'percent']:
ui.set('bat', f"{capacity:.2f}%")
ui.set('bat', f"{capacity:.0f}%")
elif self.default_display == 'temp':
ui.set('bat', f"{temp}°C")

Expand All @@ -283,4 +283,4 @@ def on_ui_update(self, ui):
logging.info(
f"[PiSugarX] Empty battery (<= {safe_shutdown_level}%): shutting down"
)
ui.update(force=True, new_data={"status": "Battery exhausted, bye ..."})
ui.update(force=True, new_data={"status": "Battery exhausted, bye ..."})

0 comments on commit de7e9b1

Please sign in to comment.