From 09ecfeed664d513e3aba8d59467002d8c566a7b1 Mon Sep 17 00:00:00 2001 From: LH <140523069+renewedbullet@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:50:37 -0500 Subject: [PATCH] Update pisugarx.py limits the voltage to x.xx Signed-off-by: LH <140523069+renewedbullet@users.noreply.github.com> --- pwnagotchi/plugins/default/pisugarx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/plugins/default/pisugarx.py b/pwnagotchi/plugins/default/pisugarx.py index 2ebd4760..65ea7bee 100644 --- a/pwnagotchi/plugins/default/pisugarx.py +++ b/pwnagotchi/plugins/default/pisugarx.py @@ -206,7 +206,7 @@ class PiSugar(plugins.Plugin): self.nextDChg = time.time() + 5 if self.drot == 0: # show battery voltage - ui.set('bat', f"{voltage}V") + ui.set('bat', f"{voltage:.2f}V") elif self.drot == 1: # show battery capacity ui.set('bat', f"{capacity}%") else: # show battery temperature @@ -216,4 +216,4 @@ class PiSugar(plugins.Plugin): logging.info( f"[PiSugarX] Empty battery (<= {self.ps.get_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 ..."})