Skip to content

Commit

Permalink
Improve node list console command format
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jackson <[email protected]>
  • Loading branch information
cdjackson committed Sep 10, 2024
1 parent ab65181 commit f596c3f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStr
}

Collections.sort(nodeIds);
String tableHeader = String.format("%-7s %-4s %-16s %-12s %-9s %-3s %-25s %-25s %-15s %-15s",
String tableHeader = String.format("%-7s %-4s %-16s %-12s %-10s %-3s %-25s %-35s %-20s %-15s",
"Network", "Addr", "IEEE Address", "Logical Type", "State", "EP", "Profile", "Device Type",
"Manufacturer", "Model");

Expand All @@ -73,9 +73,9 @@ public void process(ZigBeeNetworkManager networkManager, String[] args, PrintStr
}

private void printNode(ZigBeeNode node, PrintStream out) {
String nodeInfo = String.format("%7d %04X %-16s %-12s %-9s", node.getNetworkAddress(),
String nodeInfo = String.format("%7d %04X %-16s %-12s %-10s", node.getNetworkAddress(),
node.getNetworkAddress(), node.getIeeeAddress(), node.getLogicalType(), node.getNodeState());
String nodeInfoPadding = String.format("%7s %4s %16s %12s %9s", "", "", "", "", "");
String nodeInfoPadding = String.format("%7s %4s %16s %12s %10s", "", "", "", "", "");

List<ZigBeeEndpoint> endpoints = new ArrayList<>(node.getEndpoints());
Collections.sort(endpoints, (ep1, ep2) -> ep1.getEndpointId() - ep2.getEndpointId());
Expand All @@ -98,7 +98,7 @@ private void printNode(ZigBeeNode node, PrintStream out) {
.toString();
}
boolean showManufacturerAndModel = endpoint.getParentNode().getNetworkAddress() != 0;
String endpointInfo = String.format("%3d %-25s %-25s %-15s %-15s", endpoint.getEndpointId(),
String endpointInfo = String.format("%3d %-25s %-35s %-20s %-15s", endpoint.getEndpointId(),
profileType, deviceType, showManufacturerAndModel ? getManufacturer(endpoint) : "",
showManufacturerAndModel ? getModel(endpoint) : "");

Expand Down

0 comments on commit f596c3f

Please sign in to comment.