Skip to content

Commit 41ae6a3

Browse files
committed
Show serial number for parent expansion hub
1 parent 5ad4ef3 commit 41ae6a3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/sample/src/HubStringify.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import { RevHub } from "@rev-robotics/expansion-hub";
22

33
export function hubHierarchyToString(hub: RevHub): string {
4-
let result = `USB Expansion Hub: ${hub.moduleAddress}\n`;
5-
6-
if (hub.isExpansionHub()) {
7-
console.log(`Is open? ${hub.isOpen}`);
8-
}
4+
let result = "";
95

106
if (hub.isParent()) {
7+
result = `USB Expansion Hub: ${hub.serialNumber} ${hub.moduleAddress}\n`;
118
for (const child of hub.children) {
129
result += `\tUSB Expansion Hub: ${child.moduleAddress}\n`;
1310
}

0 commit comments

Comments
 (0)