Skip to content

Commit 6a13a86

Browse files
authored
fix: compatibility with Koenkk/zigbee2mqtt#29750 (#340)
* fix: compatibility with Koenkk/zigbee2mqtt#29750 * fix: update z2m, more fixes
1 parent c272064 commit 6a13a86

File tree

7 files changed

+47
-29
lines changed

7 files changed

+47
-29
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
}

package-lock.json

Lines changed: 34 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zigbee2mqtt-windfront",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"license": "GPL-3.0-or-later",
55
"type": "module",
66
"main": "./index.js",

src/components/device-page/tabs/Reporting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default function Reporting({ sourceIdx, device }: ReportingProps): JSX.El
124124
async (rule: ReportingRule): Promise<void> => {
125125
const { cluster, endpoint, attribute, minimum_report_interval, maximum_report_interval, reportable_change } = rule;
126126

127-
await sendMessage(sourceIdx, "bridge/request/device/configure_reporting", {
127+
await sendMessage(sourceIdx, "bridge/request/device/reporting/configure", {
128128
id: device.ieee_address,
129129
endpoint,
130130
cluster,

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
))}

src/pages/ReportingPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default function ReportingPage(): JSX.Element {
8585
const { sourceIdx, device, rule } = row.original;
8686

8787
promises.push(
88-
sendMessage(sourceIdx, "bridge/request/device/configure_reporting", {
88+
sendMessage(sourceIdx, "bridge/request/device/reporting/configure", {
8989
id: device.ieee_address,
9090
endpoint: rule.endpoint,
9191
cluster: rule.cluster,
@@ -119,7 +119,7 @@ export default function ReportingPage(): JSX.Element {
119119
const availableEndpoints = useMemo(() => getEndpoints(newRuleDevice), [newRuleDevice]);
120120

121121
const applyRule = useCallback(async (sourceIdx: number, device: Device, rule: ReportingRule): Promise<void> => {
122-
await sendMessage(sourceIdx, "bridge/request/device/configure_reporting", {
122+
await sendMessage(sourceIdx, "bridge/request/device/reporting/configure", {
123123
id: device.ieee_address,
124124
...rule,
125125
option: {},

0 commit comments

Comments
 (0)