@matter-server/dashboard 0.6.2 → 0.6.3-alpha.0-20260429-7b8104b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/esm/pages/matter-network-view.d.ts +11 -0
  2. package/dist/esm/pages/matter-network-view.d.ts.map +1 -1
  3. package/dist/esm/pages/matter-network-view.js +143 -1
  4. package/dist/esm/pages/matter-network-view.js.map +1 -1
  5. package/dist/esm/pages/network/base-network-graph.d.ts +4 -0
  6. package/dist/esm/pages/network/base-network-graph.d.ts.map +1 -1
  7. package/dist/esm/pages/network/base-network-graph.js +9 -0
  8. package/dist/esm/pages/network/base-network-graph.js.map +1 -1
  9. package/dist/esm/pages/network/network-details.d.ts +6 -6
  10. package/dist/esm/pages/network/network-details.d.ts.map +1 -1
  11. package/dist/esm/pages/network/network-details.js +74 -76
  12. package/dist/esm/pages/network/network-details.js.map +1 -1
  13. package/dist/esm/pages/network/network-types.d.ts +38 -0
  14. package/dist/esm/pages/network/network-types.d.ts.map +1 -1
  15. package/dist/esm/pages/network/network-types.js.map +1 -1
  16. package/dist/esm/pages/network/network-utils.d.ts +45 -16
  17. package/dist/esm/pages/network/network-utils.d.ts.map +1 -1
  18. package/dist/esm/pages/network/network-utils.js +115 -80
  19. package/dist/esm/pages/network/network-utils.js.map +1 -1
  20. package/dist/esm/pages/network/thread-graph.d.ts +62 -0
  21. package/dist/esm/pages/network/thread-graph.d.ts.map +1 -1
  22. package/dist/esm/pages/network/thread-graph.js +339 -31
  23. package/dist/esm/pages/network/thread-graph.js.map +2 -2
  24. package/dist/web/js/{attribute-write-dialog-g4B6BoRt.js → attribute-write-dialog-Bq4WRAPd.js} +1 -1
  25. package/dist/web/js/{command-invoke-dialog-D6G704VK.js → command-invoke-dialog-BIpV8LqS.js} +1 -1
  26. package/dist/web/js/{commission-node-dialog-Bg3oo5ub.js → commission-node-dialog-Dge7vt1X.js} +4 -4
  27. package/dist/web/js/{commission-node-existing-DO3g1aQJ.js → commission-node-existing-BbQVV2ag.js} +2 -2
  28. package/dist/web/js/{commission-node-thread-DM432aH1.js → commission-node-thread-DvHzxYrT.js} +2 -2
  29. package/dist/web/js/{commission-node-wifi-Bx40FXij.js → commission-node-wifi-sZt9CzyL.js} +2 -2
  30. package/dist/web/js/{dialog-box-DjyfULWB.js → dialog-box-CQXluAt6.js} +1 -1
  31. package/dist/web/js/{fire_event-BstgNPuh.js → fire_event-CjgNg3ka.js} +1 -1
  32. package/dist/web/js/main.js +1 -1
  33. package/dist/web/js/{matter-dashboard-app-Cj88TtbZ.js → matter-dashboard-app-DH_5WkVB.js} +777 -232
  34. package/dist/web/js/{node-binding-dialog-9yy2LE3_.js → node-binding-dialog-Dzz35dyd.js} +1 -1
  35. package/dist/web/js/{settings-dialog-Cs2xMsXb.js → settings-dialog-B-CQ09b1.js} +1 -1
  36. package/package.json +4 -4
  37. package/src/pages/matter-network-view.ts +150 -1
  38. package/src/pages/network/base-network-graph.ts +10 -0
  39. package/src/pages/network/network-details.ts +78 -93
  40. package/src/pages/network/network-types.ts +35 -0
  41. package/src/pages/network/network-utils.ts +207 -144
  42. package/src/pages/network/thread-graph.ts +470 -42
@@ -9,7 +9,9 @@ import { getCssVar } from "../../util/shared-styles.js";
9
9
  import type {
10
10
  CategorizedDevices,
11
11
  NetworkType,
12
+ SignalLevel,
12
13
  ThreadConnection,
14
+ ThreadEdgePair,
13
15
  ThreadNeighbor,
14
16
  ThreadRoute,
15
17
  UnknownThreadDevice,
@@ -451,8 +453,6 @@ export function findUnknownDevices(
451
453
  return Array.from(unknownMap.values());
452
454
  }
453
455
 
454
- export type SignalLevel = "strong" | "medium" | "weak";
455
-
456
456
  /** Determine signal level from a Thread neighbor's RSSI/LQI. */
457
457
  export function getSignalLevel(neighbor: ThreadNeighbor): SignalLevel {
458
458
  const rssi = neighbor.avgRssi ?? neighbor.lastRssi;
@@ -461,8 +461,13 @@ export function getSignalLevel(neighbor: ThreadNeighbor): SignalLevel {
461
461
  if (rssi > SIGNAL_MEDIUM_THRESHOLD) return "medium";
462
462
  return "weak";
463
463
  }
464
- if (neighbor.lqi > LQI_STRONG_THRESHOLD) return "strong";
465
- if (neighbor.lqi > LQI_MEDIUM_THRESHOLD) return "medium";
464
+ return getSignalLevelFromLqi(neighbor.lqi);
465
+ }
466
+
467
+ /** Determine signal level from an LQI value alone (e.g. route table entries without RSSI). */
468
+ export function getSignalLevelFromLqi(lqi: number): SignalLevel {
469
+ if (lqi > LQI_STRONG_THRESHOLD) return "strong";
470
+ if (lqi > LQI_MEDIUM_THRESHOLD) return "medium";
466
471
  return "weak";
467
472
  }
468
473
 
@@ -669,20 +674,73 @@ export function getWiFiVersionName(version: number | null): string {
669
674
  }
670
675
 
671
676
  /**
672
- * Builds Thread mesh connections from neighbor tables.
673
- * Returns connections with signal information.
674
- * Includes connections to unknown devices (prefixed with 'unknown_').
677
+ * Represents a connection from the perspective of a specific node.
678
+ * Includes both neighbors this node reports AND nodes that report this node as their neighbor.
675
679
  */
676
- export function buildThreadConnections(
680
+ export interface NodeConnection {
681
+ /** The connected node ID (number for known nodes, string for unknown devices) */
682
+ connectedNodeId: number | string;
683
+ /** The connected MatterNode if it's a known device */
684
+ connectedNode?: MatterNode;
685
+ /** Extended address hex string for display */
686
+ extAddressHex: string;
687
+ /** Signal strength info (if available) */
688
+ signalColor: string;
689
+ /** Undefined when link strength is unknown. */
690
+ signalLevel?: SignalLevel;
691
+ lqi: number | null;
692
+ rssi: number | null;
693
+ /** Whether this connection is from THIS node's neighbor table (true) or from the OTHER node's table (false) */
694
+ isOutgoing: boolean;
695
+ /** True when only the peer reports this edge — this node has no matching neighbor-table entry. Surfaces true asymmetric visibility, distinct from a reverse view caused by filtering. */
696
+ isReverseOnly: boolean;
697
+ /** Whether this is an unknown/external device */
698
+ isUnknown: boolean;
699
+ /** Path cost from route table (1 = direct, higher = multi-hop). Only available for routers. */
700
+ pathCost?: number;
701
+ /** Bidirectional LQI from route table (average of lqiIn and lqiOut) */
702
+ bidirectionalLqi?: number;
703
+ }
704
+
705
+ /**
706
+ * Creates a canonical pair key from two node IDs.
707
+ * The key is always ordered so that the same pair produces the same key regardless of direction.
708
+ */
709
+ export function makePairKey(a: string, b: string): string {
710
+ return a < b ? `${a}|${b}` : `${b}|${a}`;
711
+ }
712
+
713
+ /**
714
+ * Computes a numeric signal score for edge comparison.
715
+ * Lower score = weaker signal (worst case).
716
+ */
717
+ export function getEdgeSignalScore(conn: ThreadConnection): number {
718
+ const levelScore =
719
+ conn.signalLevel === "strong"
720
+ ? 3000
721
+ : conn.signalLevel === "medium"
722
+ ? 2000
723
+ : conn.signalLevel === "weak"
724
+ ? 1000
725
+ : 0;
726
+ const detail = conn.rssi !== null ? conn.rssi + 200 : conn.lqi;
727
+ return levelScore + detail;
728
+ }
729
+
730
+ /**
731
+ * Builds edge pairs for all Thread connections.
732
+ * Each pair represents two connected nodes with up to 2 directional edges
733
+ * (one from each node's neighbor/route table). No dedup is performed —
734
+ * callers are responsible for selecting which edge to display per pair.
735
+ */
736
+ export function buildThreadEdgePairs(
677
737
  nodes: Record<string, MatterNode>,
678
738
  extAddrMap: Map<bigint, string>,
679
739
  rloc16Map: Map<number, string>,
680
740
  unknownDevices: UnknownThreadDevice[],
681
- ): ThreadConnection[] {
682
- const connections: ThreadConnection[] = [];
683
- const seenConnections = new Set<string>();
741
+ ): Map<string, ThreadEdgePair> {
742
+ const pairs = new Map<string, ThreadEdgePair>();
684
743
 
685
- // Build map of unknown device extAddress -> id
686
744
  const unknownExtAddrMap = new Map<bigint, string>();
687
745
  for (const unknown of unknownDevices) {
688
746
  unknownExtAddrMap.set(unknown.extAddress, unknown.id);
@@ -693,55 +751,50 @@ export function buildThreadConnections(
693
751
  const neighbors = parseNeighborTable(node);
694
752
 
695
753
  for (const neighbor of neighbors) {
696
- // Try to find in known devices first (extAddress, then RLOC16 fallback)
697
754
  let toNodeId: string | undefined = extAddrMap.get(neighbor.extAddress);
698
755
  if (toNodeId === undefined && neighbor.rloc16 !== 0) {
699
756
  toNodeId = rloc16Map.get(neighbor.rloc16);
700
757
  }
701
-
702
- // If not found, check unknown devices
703
758
  if (toNodeId === undefined) {
704
759
  toNodeId = unknownExtAddrMap.get(neighbor.extAddress);
705
760
  }
761
+ if (toNodeId === undefined || fromNodeId === toNodeId) continue;
706
762
 
707
- if (toNodeId === undefined) {
708
- // Should not happen if unknownDevices was built correctly
709
- continue;
763
+ const pairKey = makePairKey(fromNodeId, toNodeId);
764
+ if (!pairs.has(pairKey)) {
765
+ const [nodeA, nodeB] = fromNodeId < toNodeId ? [fromNodeId, toNodeId] : [toNodeId, fromNodeId];
766
+ pairs.set(pairKey, { pairKey, nodeA, nodeB });
710
767
  }
711
768
 
712
- // Skip self-connections
713
- if (fromNodeId === toNodeId) {
714
- continue;
715
- }
769
+ const pair = pairs.get(pairKey)!;
770
+ const isFromA = fromNodeId === pair.nodeA;
716
771
 
717
- // Create a unique key for this connection
718
- const connectionKey = `${fromNodeId}-${toNodeId}`;
719
- const reverseKey = `${toNodeId}-${fromNodeId}`;
772
+ // Neighbor table entry takes precedence — skip if already present for this direction
773
+ if (isFromA && pair.edgeAB) continue;
774
+ if (!isFromA && pair.edgeBA) continue;
720
775
 
721
- if (seenConnections.has(connectionKey) || seenConnections.has(reverseKey)) {
722
- // Already have this connection
723
- continue;
724
- }
725
- seenConnections.add(connectionKey);
726
-
727
- // Look up route table entry for supplementary data (pathCost, bidirectional LQI)
728
776
  const routeEntry = findRouteByExtAddress(node, neighbor.extAddress);
729
777
  const bidirectionalLqi = routeEntry ? getRouteBidirectionalLqi(routeEntry) : undefined;
730
778
 
731
- // Always use neighbor table RSSI/LQI for signal color (most accurate link quality)
732
- connections.push({
779
+ const edge: ThreadConnection = {
733
780
  fromNodeId,
734
781
  toNodeId,
735
782
  signalColor: getSignalColor(neighbor),
783
+ signalLevel: getSignalLevel(neighbor),
736
784
  lqi: neighbor.lqi,
737
785
  rssi: neighbor.avgRssi ?? neighbor.lastRssi,
738
786
  pathCost: routeEntry?.pathCost,
739
787
  bidirectionalLqi,
740
- });
788
+ };
789
+
790
+ if (isFromA) {
791
+ pair.edgeAB = edge;
792
+ } else {
793
+ pair.edgeBA = edge;
794
+ }
741
795
  }
742
796
 
743
- // Check route table for connections not in neighbor table (supplementary data)
744
- // This helps when neighbor table is stale or incomplete
797
+ // Supplementary: route table entries not already covered by neighbor table
745
798
  const routes = parseRouteTable(node);
746
799
  for (const route of routes) {
747
800
  if (!route.linkEstablished || !route.allocated) continue;
@@ -755,156 +808,166 @@ export function buildThreadConnections(
755
808
  }
756
809
  if (toNodeId === undefined || toNodeId === fromNodeId) continue;
757
810
 
758
- const connectionKey = `${fromNodeId}-${toNodeId}`;
759
- const reverseKey = `${toNodeId}-${fromNodeId}`;
760
-
761
- // Only add if we don't already have this connection from neighbor table
762
- if (seenConnections.has(connectionKey) || seenConnections.has(reverseKey)) {
763
- continue;
811
+ const pairKey = makePairKey(fromNodeId, toNodeId);
812
+ if (!pairs.has(pairKey)) {
813
+ const [nodeA, nodeB] = fromNodeId < toNodeId ? [fromNodeId, toNodeId] : [toNodeId, fromNodeId];
814
+ pairs.set(pairKey, { pairKey, nodeA, nodeB });
764
815
  }
765
- seenConnections.add(connectionKey);
816
+
817
+ const pair = pairs.get(pairKey)!;
818
+ const isFromA = fromNodeId === pair.nodeA;
819
+
820
+ // Only add from route table if no neighbor table edge for this direction
821
+ if (isFromA && pair.edgeAB) continue;
822
+ if (!isFromA && pair.edgeBA) continue;
766
823
 
767
824
  const bidirectionalLqi = getRouteBidirectionalLqi(route);
768
825
  const signalColor =
769
826
  bidirectionalLqi !== undefined
770
827
  ? getSignalColorFromLqi(bidirectionalLqi)
771
- : "var(--md-sys-color-outline, grey)"; // Unknown signal
828
+ : "var(--md-sys-color-outline, grey)";
772
829
 
773
- connections.push({
830
+ const edge: ThreadConnection = {
774
831
  fromNodeId,
775
832
  toNodeId,
776
833
  signalColor,
834
+ signalLevel: bidirectionalLqi !== undefined ? getSignalLevelFromLqi(bidirectionalLqi) : undefined,
777
835
  lqi: bidirectionalLqi ?? 0,
778
836
  rssi: null,
779
837
  pathCost: route.pathCost,
780
838
  bidirectionalLqi,
781
839
  fromRouteTable: true,
782
- });
840
+ };
841
+
842
+ if (isFromA) {
843
+ pair.edgeAB = edge;
844
+ } else {
845
+ pair.edgeBA = edge;
846
+ }
783
847
  }
784
848
  }
785
849
 
786
- return connections;
850
+ return pairs;
787
851
  }
788
852
 
789
853
  /**
790
- * Represents a connection from the perspective of a specific node.
791
- * Includes both neighbors this node reports AND nodes that report this node as their neighbor.
854
+ * Filter options for edge visibility, matching the graph's filter pipeline.
792
855
  */
793
- export interface NodeConnection {
794
- /** The connected node ID (number for known nodes, string for unknown devices) */
795
- connectedNodeId: number | string;
796
- /** The connected MatterNode if it's a known device */
797
- connectedNode?: MatterNode;
798
- /** Extended address hex string for display */
799
- extAddressHex: string;
800
- /** Signal strength info (if available) */
801
- signalColor: string;
802
- lqi: number | null;
803
- rssi: number | null;
804
- /** Whether this connection is from THIS node's neighbor table (true) or from the OTHER node's table (false) */
805
- isOutgoing: boolean;
806
- /** Whether this is an unknown/external device */
807
- isUnknown: boolean;
808
- /** Path cost from route table (1 = direct, higher = multi-hop). Only available for routers. */
809
- pathCost?: number;
810
- /** Bidirectional LQI from route table (average of lqiIn and lqiOut) */
811
- bidirectionalLqi?: number;
856
+ export interface EdgeFilterOptions {
857
+ hideOfflineNodes?: boolean;
858
+ hideWeakSignalEdges?: boolean;
859
+ hideMediumSignalEdges?: boolean;
860
+ hideStrongSignalEdges?: boolean;
812
861
  }
813
862
 
814
863
  /**
815
- * Get all connections for a specific node (bidirectional).
816
- * This includes:
817
- * 1. Neighbors this node reports in its neighbor table (outgoing)
818
- * 2. Nodes that report this node as their neighbor (incoming)
864
+ * Derives NodeConnection[] from pre-computed edge pairs for a given node.
865
+ * Uses the same edge pairs as the graph, ensuring the side panel and the
866
+ * graph always agree on which connections exist.
867
+ *
868
+ * The function mirrors the graph's exact pipeline:
869
+ * 1. Filter each edge independently (offline cascade + signal level)
870
+ * 2. Among survivors per pair, prefer the outgoing edge (matches graph
871
+ * highlight swap); fall back to worst signal (matches graph dedup)
819
872
  *
820
- * Returns a deduplicated list - if both directions exist, only the outgoing one is included
821
- * (since that has signal data from THIS node's perspective).
873
+ * When filters are omitted, no filtering is applied and the outgoing
874
+ * edge is preferred (useful for the "update connections" dialog).
822
875
  *
823
- * @param nodeId - Node ID as string to avoid BigInt precision loss
876
+ * One entry per connected peer (no duplicates).
824
877
  */
825
- export function getNodeConnections(
878
+ export function getNodeConnectionsFromPairs(
826
879
  nodeId: string,
880
+ edgePairs: Map<string, ThreadEdgePair>,
827
881
  nodes: Record<string, MatterNode>,
828
- extAddrMap: Map<bigint, string>,
829
- rloc16Map?: Map<number, string>,
882
+ filters?: EdgeFilterOptions,
830
883
  ): NodeConnection[] {
831
884
  const connections: NodeConnection[] = [];
832
- const seenConnectedIds = new Set<string>();
833
885
 
834
- const node = nodes[nodeId];
835
- if (!node) return connections;
886
+ // Build set of hidden node IDs (offline cascade, same as graph)
887
+ const hiddenNodeIds = new Set<string>();
888
+ if (filters?.hideOfflineNodes) {
889
+ for (const node of Object.values(nodes)) {
890
+ if (node.available === false) {
891
+ hiddenNodeIds.add(String(node.node_id));
892
+ }
893
+ }
894
+ }
895
+
896
+ for (const pair of edgePairs.values()) {
897
+ const isA = pair.nodeA === nodeId;
898
+ const isB = pair.nodeB === nodeId;
899
+ if (!isA && !isB) continue;
900
+
901
+ const remoteId = isA ? pair.nodeB : pair.nodeA;
902
+ const outgoing = isA ? pair.edgeAB : pair.edgeBA;
903
+ const incoming = isA ? pair.edgeBA : pair.edgeAB;
904
+
905
+ // Apply filters to each edge independently (mirrors graph pipeline)
906
+ const survivors: { conn: ThreadConnection; isOutgoing: boolean }[] = [];
836
907
 
837
- // Get this node's extended address for reverse lookups (from General Diagnostics, not Thread Diagnostics)
838
- const thisExtAddr = getThreadExtendedAddress(node);
908
+ for (const [conn, isOut] of [
909
+ [outgoing, true],
910
+ [incoming, false],
911
+ ] as const) {
912
+ if (!conn) continue;
839
913
 
840
- // 1. Add neighbors this node reports (outgoing connections)
841
- const neighbors = parseNeighborTable(node);
842
- for (const neighbor of neighbors) {
843
- let connectedNodeId = extAddrMap.get(neighbor.extAddress);
844
- if (connectedNodeId === undefined && rloc16Map && neighbor.rloc16 !== 0) {
845
- connectedNodeId = rloc16Map.get(neighbor.rloc16);
914
+ if (filters) {
915
+ const fromId = String(conn.fromNodeId);
916
+ const toId = String(conn.toNodeId);
917
+
918
+ // Offline cascade: skip if either endpoint is hidden
919
+ if (hiddenNodeIds.has(fromId) || hiddenNodeIds.has(toId)) continue;
920
+
921
+ // Signal level filters
922
+ if (filters.hideWeakSignalEdges && conn.signalLevel === "weak") continue;
923
+ if (filters.hideMediumSignalEdges && conn.signalLevel === "medium") continue;
924
+ if (filters.hideStrongSignalEdges && conn.signalLevel === "strong") continue;
925
+ }
926
+
927
+ survivors.push({ conn, isOutgoing: isOut });
846
928
  }
847
- const connectedNode = connectedNodeId ? nodes[connectedNodeId] : undefined;
848
- const isUnknown = connectedNodeId === undefined;
849
- const displayId: string =
850
- connectedNodeId ?? `unknown_${neighbor.extAddress.toString(16).toUpperCase().padStart(16, "0")}`;
851
929
 
852
- seenConnectedIds.add(displayId);
930
+ if (survivors.length === 0) continue;
931
+
932
+ // Among survivors: prefer outgoing (matches graph highlight swap),
933
+ // fall back to worst signal (matches graph dedup)
934
+ let winner: { conn: ThreadConnection; isOutgoing: boolean };
935
+ const outgoingSurvivor = survivors.find(s => s.isOutgoing);
936
+ if (outgoingSurvivor) {
937
+ winner = outgoingSurvivor;
938
+ } else {
939
+ survivors.sort((a, b) => getEdgeSignalScore(a.conn) - getEdgeSignalScore(b.conn));
940
+ winner = survivors[0];
941
+ }
853
942
 
854
- // Look up route table entry for enhanced data
855
- const routeEntry = findRouteByExtAddress(node, neighbor.extAddress);
856
- const bidirectionalLqi = routeEntry ? getRouteBidirectionalLqi(routeEntry) : undefined;
943
+ const remoteNode = nodes[remoteId];
944
+ const isUnknown = remoteId.startsWith("unknown_");
945
+
946
+ // Derive extended address hex for display
947
+ let extAddressHex: string;
948
+ if (isUnknown) {
949
+ extAddressHex = remoteId.slice("unknown_".length);
950
+ } else if (remoteNode) {
951
+ extAddressHex = getThreadExtendedAddressHex(remoteNode) ?? "Unknown";
952
+ } else {
953
+ extAddressHex = "Unknown";
954
+ }
857
955
 
858
956
  connections.push({
859
- connectedNodeId: displayId,
860
- connectedNode,
861
- extAddressHex: neighbor.extAddress.toString(16).toUpperCase().padStart(16, "0"),
862
- signalColor: getSignalColor(neighbor),
863
- lqi: neighbor.lqi,
864
- rssi: neighbor.avgRssi ?? neighbor.lastRssi,
865
- isOutgoing: true,
957
+ connectedNodeId: remoteId,
958
+ connectedNode: remoteNode,
959
+ extAddressHex,
960
+ signalColor: winner.conn.signalColor,
961
+ signalLevel: winner.conn.signalLevel,
962
+ lqi: winner.conn.lqi,
963
+ rssi: winner.conn.rssi,
964
+ isOutgoing: winner.isOutgoing,
965
+ isReverseOnly: !outgoing,
866
966
  isUnknown,
867
- pathCost: routeEntry?.pathCost,
868
- bidirectionalLqi,
967
+ pathCost: winner.conn.pathCost,
968
+ bidirectionalLqi: winner.conn.bidirectionalLqi,
869
969
  });
870
970
  }
871
971
 
872
- // 2. Find nodes that report THIS node as their neighbor (incoming connections)
873
- if (thisExtAddr !== undefined) {
874
- for (const otherNode of Object.values(nodes)) {
875
- const otherNodeId = String(otherNode.node_id);
876
- if (otherNodeId === nodeId) continue; // Skip self
877
-
878
- // Check if already connected via outgoing
879
- if (seenConnectedIds.has(otherNodeId)) continue;
880
-
881
- // Check if other node reports this node as neighbor
882
- const otherNeighbors = parseNeighborTable(otherNode);
883
- const reverseEntry = otherNeighbors.find(n => n.extAddress === thisExtAddr);
884
-
885
- if (reverseEntry) {
886
- const otherExtAddr = getThreadExtendedAddress(otherNode);
887
- const extAddrHex = otherExtAddr ? otherExtAddr.toString(16).toUpperCase().padStart(16, "0") : "Unknown";
888
-
889
- // Look up route table entry from the other node's perspective
890
- const routeEntry = findRouteByExtAddress(otherNode, thisExtAddr);
891
- const bidirectionalLqi = routeEntry ? getRouteBidirectionalLqi(routeEntry) : undefined;
892
-
893
- connections.push({
894
- connectedNodeId: otherNodeId,
895
- connectedNode: otherNode,
896
- extAddressHex: extAddrHex,
897
- signalColor: getSignalColor(reverseEntry),
898
- lqi: reverseEntry.lqi,
899
- rssi: reverseEntry.avgRssi ?? reverseEntry.lastRssi,
900
- isOutgoing: false,
901
- isUnknown: false,
902
- pathCost: routeEntry?.pathCost,
903
- bidirectionalLqi,
904
- });
905
- }
906
- }
907
- }
908
-
909
972
  return connections;
910
973
  }