mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-25 15:10:17 +00:00
Add rnode battery state to rnstatus output
This commit is contained in:
parent
60d8da843c
commit
7417cf5947
@ -1328,7 +1328,7 @@ class Reticulum:
|
|||||||
|
|
||||||
if hasattr(interface, "r_battery_state"):
|
if hasattr(interface, "r_battery_state"):
|
||||||
if interface.r_battery_state != 0x00:
|
if interface.r_battery_state != 0x00:
|
||||||
ifstats["battery_state"] = interface.r_battery_state
|
ifstats["battery_state"] = interface.get_battery_state_string()
|
||||||
|
|
||||||
if hasattr(interface, "r_battery_percent"):
|
if hasattr(interface, "r_battery_percent"):
|
||||||
ifstats["battery_percent"] = interface.r_battery_percent
|
ifstats["battery_percent"] = interface.r_battery_percent
|
||||||
|
@ -295,7 +295,8 @@ def program_setup(configdir, dispall=False, verbosity=0, name_filter=None, json=
|
|||||||
if "battery_percent" in ifstat and ifstat["battery_percent"] != None:
|
if "battery_percent" in ifstat and ifstat["battery_percent"] != None:
|
||||||
try:
|
try:
|
||||||
bpi = int(ifstat["battery_percent"])
|
bpi = int(ifstat["battery_percent"])
|
||||||
print(" Battery : {bp}%".format(bp=bpi))
|
bss = ifstat["battery_state"]
|
||||||
|
print(f" Battery : {bpi}% ({bss})")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user