Skip to content

Commit 0388fab

Browse files
committed
fix: compatibility with Koenkk/zigbee2mqtt#29750
1 parent c272064 commit 0388fab

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

mocks/ws.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ export function startServer() {
138138

139139
(response.payload.data.value as Zigbee2MQTTNetworkMap).links[0].routes.push(
140140
...[
141-
{ destinationAddress: 0x1234, nextHop: 14567, status: "ACTIVE" },
142-
{ destinationAddress: 0x5678, nextHop: 14567, status: "DISCOVERY_UNDERWAY" },
143-
{ destinationAddress: 0x2345, nextHop: 14567, status: "DISCOVERY_FAILED" },
144-
{ destinationAddress: 0x7890, nextHop: 14567, status: "INACTIVE" },
141+
{ destinationAddress: 0x1234, nextHopAddress: 14567, status: "ACTIVE" },
142+
{ destinationAddress: 0x5678, nextHopAddress: 14567, status: "DISCOVERY_UNDERWAY" },
143+
{ destinationAddress: 0x2345, nextHopAddress: 14567, status: "DISCOVERY_FAILED" },
144+
{ destinationAddress: 0x7890, nextHopAddress: 14567, status: "INACTIVE" },
145145
],
146146
);
147147
}

src/components/network-page/RawNetworkMap.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ const RawNetworkMap = memo(({ sourceIdx, map }: RawNetworkMapProps) => {
176176
!bestSibling ||
177177
// XXX: add exception when depth===255 (non-value)?
178178
link.depth < bestSibling.depth ||
179-
link.linkquality > bestSibling.linkquality ||
180-
(bestSibling.linkquality === link.linkquality && link.depth < bestSibling.depth)
179+
link.lqi > bestSibling.lqi ||
180+
(bestSibling.lqi === link.lqi && link.depth < bestSibling.depth)
181181
) {
182182
bestSiblings.set(link.source.ieeeAddr, link);
183183
}
@@ -223,7 +223,7 @@ const RawNetworkMap = memo(({ sourceIdx, map }: RawNetworkMapProps) => {
223223
computedEdges.push({
224224
id: `${link.source.ieeeAddr}-${link.target.ieeeAddr}-${link.relationship}`,
225225
data: link,
226-
label: oppositeLink ? `${link.linkquality} / ${oppositeLink.linkquality ?? "?"}` : `${link.linkquality}`,
226+
label: oppositeLink ? `${link.lqi} / ${oppositeLink.lqi ?? "?"}` : `${link.lqi}`,
227227
size: link.relationship === ZigbeeRelationship.NoneOfTheAbove ? 0.5 : 1,
228228
labelVisible: true,
229229
source: link.source.ieeeAddr,

src/components/network-page/raw-data/RawRelation.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const RawRelation = memo(({ sourceIdx, relation, device, highlight, setHighlight
4242
</div>
4343
<div className="grow">{device.friendly_name}</div>
4444
<span className="badge badge-ghost">
45-
<Lqi value={relation.linkquality} />
45+
<Lqi value={relation.lqi} />
4646
</span>
4747
<span className="badge badge-ghost" title={t(($) => $.depth)}>
4848
<FontAwesomeIcon icon={faRoute} />
@@ -67,10 +67,9 @@ const RawRelation = memo(({ sourceIdx, relation, device, highlight, setHighlight
6767
</li>
6868
<ul>
6969
{relation.routes.map((route) => (
70-
<li key={`${relation.source.ieeeAddr}-${route.destinationAddress}-${route.nextHop}-${route.status}`}>
70+
<li key={`${relation.source.ieeeAddr}-${route.destinationAddress}-${route.nextHopAddress}-${route.status}`}>
7171
<span>
7272
{toHex(route.destinationAddress)} : {route.status}
73-
{/** XXX: Z2M currently removes non-ACTIVE status */}
7473
</span>
7574
</li>
7675
))}

0 commit comments

Comments
 (0)