mirror of
https://github.com/meshtastic/python.git
synced 2026-02-04 13:01:17 -05:00
Nicer printing
This commit is contained in:
@@ -65,6 +65,7 @@ def getPref(interface, dest, comp_name):
|
||||
logging.debug(f'snake_name:{snake_name} camel_name:{camel_name}')
|
||||
logging.debug(f'use camel:{Globals.getInstance().get_camel_case()}')
|
||||
|
||||
# First validate the input by looking at config of connected node
|
||||
localConfig = interface.getNode(BROADCAST_ADDR).localConfig
|
||||
moduleConfig = interface.getNode(BROADCAST_ADDR).moduleConfig
|
||||
found = False
|
||||
@@ -103,7 +104,7 @@ def getPref(interface, dest, comp_name):
|
||||
print(f"{str(config_type.name)}: {str(config_values)}")
|
||||
logging.debug(f"{str(config_type.name)}: {str(config_values)}")
|
||||
else:
|
||||
# Always request full config for remote node
|
||||
# Always show full config for remote node
|
||||
interface.getNode(dest, False).requestConfig(config_type)
|
||||
|
||||
return True
|
||||
|
||||
@@ -78,10 +78,13 @@ class Node:
|
||||
self.iface._acknowledgment.receivedNak = True
|
||||
else:
|
||||
self.iface._acknowledgment.receivedAck = True
|
||||
print("")
|
||||
if "getConfigResponse" in p["decoded"]["admin"]:
|
||||
print("Config is as follows:", p["decoded"]["admin"]['getConfigResponse'])
|
||||
prefs = stripnl(p["decoded"]["admin"]["getConfigResponse"])
|
||||
print(f"Preferences: {prefs}\n")
|
||||
else:
|
||||
print("Module Config is as follows:", p["decoded"]["admin"]['getModuleConfigResponse'])
|
||||
prefs = stripnl(p["decoded"]["admin"]["getModuleConfigResponse"])
|
||||
print(f"Module preferences: {prefs}\n")
|
||||
|
||||
def requestConfig(self, configType):
|
||||
print("Requesting config from remote node (this can take a while).")
|
||||
|
||||
Reference in New Issue
Block a user