Skip to content

Commit 7417cf5

Browse files
committed
Add rnode battery state to rnstatus output
1 parent 60d8da8 commit 7417cf5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

RNS/Reticulum.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ def get_interface_stats(self):
13281328

13291329
if hasattr(interface, "r_battery_state"):
13301330
if interface.r_battery_state != 0x00:
1331-
ifstats["battery_state"] = interface.r_battery_state
1331+
ifstats["battery_state"] = interface.get_battery_state_string()
13321332

13331333
if hasattr(interface, "r_battery_percent"):
13341334
ifstats["battery_percent"] = interface.r_battery_percent

RNS/Utilities/rnstatus.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
295295
if "battery_percent" in ifstat and ifstat["battery_percent"] != None:
296296
try:
297297
bpi = int(ifstat["battery_percent"])
298-
print(" Battery : {bp}%".format(bp=bpi))
298+
bss = ifstat["battery_state"]
299+
print(f" Battery : {bpi}% ({bss})")
299300
except:
300301
pass
301302

0 commit comments

Comments
 (0)