diff --git a/pwnagotchi/plugins/default/pisugarx.py b/pwnagotchi/plugins/default/pisugarx.py index 7cd25c18..f50aba81 100644 --- a/pwnagotchi/plugins/default/pisugarx.py +++ b/pwnagotchi/plugins/default/pisugarx.py @@ -264,7 +264,7 @@ 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: @@ -272,7 +272,7 @@ def on_ui_update(self, ui): 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") @@ -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 ..."}) \ No newline at end of file + ui.update(force=True, new_data={"status": "Battery exhausted, bye ..."})