@matter-server/dashboard 1.3.3 → 1.4.0-alpha.0-20260802-ac0d816
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.
- package/dist/esm/client/models/descriptions.d.ts.map +1 -1
- package/dist/esm/client/models/descriptions.js +67 -62
- package/dist/esm/client/models/descriptions.js.map +1 -1
- package/dist/esm/components/avsum-ptz-strip.d.ts.map +1 -1
- package/dist/esm/components/avsum-ptz-strip.js +75 -75
- package/dist/esm/components/avsum-ptz-strip.js.map +1 -1
- package/dist/esm/components/dialog-box/dialog-box.d.ts.map +1 -1
- package/dist/esm/components/dialog-box/dialog-box.js +6 -4
- package/dist/esm/components/dialog-box/dialog-box.js.map +1 -1
- package/dist/esm/components/dialogs/acl/acl-actions.d.ts.map +1 -1
- package/dist/esm/components/dialogs/acl/acl-actions.js +11 -4
- package/dist/esm/components/dialogs/acl/acl-actions.js.map +1 -1
- package/dist/esm/components/dialogs/acl/node-acl-add-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/acl/node-acl-add-dialog.js +15 -15
- package/dist/esm/components/dialogs/acl/node-acl-add-dialog.js.map +1 -1
- package/dist/esm/components/dialogs/binding/binding-actions.d.ts +8 -3
- package/dist/esm/components/dialogs/binding/binding-actions.d.ts.map +1 -1
- package/dist/esm/components/dialogs/binding/binding-actions.js +45 -11
- package/dist/esm/components/dialogs/binding/binding-actions.js.map +1 -1
- package/dist/esm/components/dialogs/binding/node-binding-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/binding/node-binding-dialog.js +37 -37
- package/dist/esm/components/dialogs/binding/node-binding-dialog.js.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-dialog.js +16 -16
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-dialog.js.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-thread.d.ts.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-thread.js +13 -13
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-thread.js.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-wifi.d.ts.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-wifi.js +13 -13
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-wifi.js.map +1 -1
- package/dist/esm/components/dialogs/dev/attribute-write-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/dev/attribute-write-dialog.js +5 -1
- package/dist/esm/components/dialogs/dev/attribute-write-dialog.js.map +1 -1
- package/dist/esm/components/dialogs/dev/command-invoke-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/dev/command-invoke-dialog.js +3 -3
- package/dist/esm/components/dialogs/dev/command-invoke-dialog.js.map +1 -1
- package/dist/esm/components/dialogs/settings/log-level-section.d.ts.map +1 -1
- package/dist/esm/components/dialogs/settings/log-level-section.js +14 -14
- package/dist/esm/components/dialogs/settings/log-level-section.js.map +1 -1
- package/dist/esm/components/dialogs/settings/settings-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/settings/settings-dialog.js +83 -81
- package/dist/esm/components/dialogs/settings/settings-dialog.js.map +1 -1
- package/dist/esm/components/webrtc-stream-view.d.ts.map +1 -1
- package/dist/esm/components/webrtc-stream-view.js +11 -11
- package/dist/esm/components/webrtc-stream-view.js.map +1 -1
- package/dist/esm/pages/camera-overlay.d.ts.map +1 -1
- package/dist/esm/pages/camera-overlay.js +90 -87
- package/dist/esm/pages/camera-overlay.js.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/access-control-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/access-control-commands.js +32 -28
- package/dist/esm/pages/cluster-commands/clusters/access-control-commands.js.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/avsum-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/avsum-commands.js +130 -129
- package/dist/esm/pages/cluster-commands/clusters/avsum-commands.js.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/basic-information-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/basic-information-commands.js.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/binding-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/binding-commands.js +32 -30
- package/dist/esm/pages/cluster-commands/clusters/binding-commands.js.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/chime-commands.d.ts +5 -0
- package/dist/esm/pages/cluster-commands/clusters/chime-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/chime-commands.js +45 -24
- package/dist/esm/pages/cluster-commands/clusters/chime-commands.js.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/closure-control-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/closure-control-commands.js +79 -79
- package/dist/esm/pages/cluster-commands/clusters/closure-control-commands.js.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/icd-management-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/icd-management-commands.js +27 -20
- package/dist/esm/pages/cluster-commands/clusters/icd-management-commands.js.map +1 -1
- package/dist/esm/pages/components/header.d.ts.map +1 -1
- package/dist/esm/pages/components/header.js +32 -32
- package/dist/esm/pages/components/header.js.map +1 -1
- package/dist/esm/pages/components/node-details.d.ts.map +1 -1
- package/dist/esm/pages/components/node-details.js +43 -42
- package/dist/esm/pages/components/node-details.js.map +1 -1
- package/dist/esm/pages/matter-cluster-view.d.ts +3 -0
- package/dist/esm/pages/matter-cluster-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-cluster-view.js +105 -90
- package/dist/esm/pages/matter-cluster-view.js.map +1 -1
- package/dist/esm/pages/matter-endpoint-view.d.ts +3 -2
- package/dist/esm/pages/matter-endpoint-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-endpoint-view.js +65 -20
- package/dist/esm/pages/matter-endpoint-view.js.map +1 -1
- package/dist/esm/pages/matter-network-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-network-view.js +20 -20
- package/dist/esm/pages/matter-network-view.js.map +1 -1
- package/dist/esm/pages/matter-node-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-node-view.js +9 -5
- package/dist/esm/pages/matter-node-view.js.map +1 -1
- package/dist/esm/pages/matter-server-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-server-view.js +6 -6
- package/dist/esm/pages/matter-server-view.js.map +1 -1
- package/dist/esm/pages/network/device-panel.d.ts.map +1 -1
- package/dist/esm/pages/network/device-panel.js +10 -10
- package/dist/esm/pages/network/device-panel.js.map +1 -1
- package/dist/esm/pages/network/network-details.d.ts.map +1 -1
- package/dist/esm/pages/network/network-details.js +384 -382
- package/dist/esm/pages/network/network-details.js.map +1 -1
- package/dist/esm/pages/network/thread-graph.d.ts.map +1 -1
- package/dist/esm/pages/network/thread-graph.js.map +1 -1
- package/dist/esm/pages/network/update-connections-dialog.d.ts.map +1 -1
- package/dist/esm/pages/network/update-connections-dialog.js +30 -30
- package/dist/esm/pages/network/update-connections-dialog.js.map +1 -1
- package/dist/esm/util/binding.d.ts +18 -0
- package/dist/esm/util/binding.d.ts.map +1 -1
- package/dist/esm/util/binding.js +28 -6
- package/dist/esm/util/binding.js.map +1 -1
- package/dist/esm/util/chime.d.ts.map +1 -1
- package/dist/esm/util/chime.js +9 -2
- package/dist/esm/util/chime.js.map +1 -1
- package/dist/esm/util/icd.d.ts +6 -2
- package/dist/esm/util/icd.d.ts.map +1 -1
- package/dist/esm/util/icd.js +6 -6
- package/dist/esm/util/icd.js.map +1 -1
- package/dist/esm/util/matter-status.d.ts +11 -0
- package/dist/esm/util/matter-status.d.ts.map +1 -1
- package/dist/esm/util/matter-status.js +16 -0
- package/dist/esm/util/matter-status.js.map +1 -1
- package/dist/esm/util/node-label.d.ts +1 -1
- package/dist/esm/util/node-label.d.ts.map +1 -1
- package/dist/esm/util/node-label.js +6 -2
- package/dist/esm/util/node-label.js.map +1 -1
- package/dist/esm/util/shared-styles.d.ts +2 -0
- package/dist/esm/util/shared-styles.d.ts.map +1 -1
- package/dist/esm/util/shared-styles.js +38 -0
- package/dist/esm/util/shared-styles.js.map +1 -1
- package/dist/web/index.html +1 -0
- package/dist/web/js/{attribute-write-dialog-Dfm95ZtQ.js → attribute-write-dialog-lNuCZ3k9.js} +2 -2
- package/dist/web/js/{command-invoke-dialog-DrORSE5f.js → command-invoke-dialog-BsvOYKuy.js} +4 -4
- package/dist/web/js/{commission-node-dialog-Wjb4chGv.js → commission-node-dialog-BHdEFbdo.js} +21 -21
- package/dist/web/js/{commission-node-existing-Ykm-eejQ.js → commission-node-existing-DHnKVo6U.js} +1 -1
- package/dist/web/js/{commission-node-thread-DacHGwnB.js → commission-node-thread-Cj3toV8W.js} +14 -14
- package/dist/web/js/{commission-node-wifi-CEKp93HM.js → commission-node-wifi-BdAS2Vof.js} +14 -14
- package/dist/web/js/{dialog-box-DEKE_ZlH.js → dialog-box-DQV4kYxU.js} +7 -5
- package/dist/web/js/{fabric-label-dialog-CcMZOA7F.js → fabric-label-dialog-Be5bxfzQ.js} +1 -1
- package/dist/web/js/main.js +1 -1
- package/dist/web/js/{matter-dashboard-app-CEG7MSLx.js → matter-dashboard-app-B186DbKC.js} +1494 -1209
- package/dist/web/js/{node-acl-add-dialog-BDM3Rcou.js → node-acl-add-dialog-D4ZLnora.js} +16 -16
- package/dist/web/js/{node-binding-dialog-CYsbUPsh.js → node-binding-dialog-MGTLF9MJ.js} +38 -38
- package/dist/web/js/{node-label-dialog-DFIMPMuJ.js → node-label-dialog-DgbTIGwf.js} +1 -1
- package/dist/web/js/{settings-dialog-CGXliJcr.js → settings-dialog-BQJbHl4j.js} +98 -96
- package/package.json +3 -3
- package/src/client/models/descriptions.ts +67 -62
- package/src/components/avsum-ptz-strip.ts +109 -100
- package/src/components/dialog-box/dialog-box.ts +20 -12
- package/src/components/dialogs/acl/acl-actions.ts +15 -6
- package/src/components/dialogs/acl/node-acl-add-dialog.ts +35 -29
- package/src/components/dialogs/binding/binding-actions.ts +58 -15
- package/src/components/dialogs/binding/node-binding-dialog.ts +78 -66
- package/src/components/dialogs/commission-node-dialog/commission-node-dialog.ts +25 -23
- package/src/components/dialogs/commission-node-dialog/commission-node-thread.ts +22 -20
- package/src/components/dialogs/commission-node-dialog/commission-node-wifi.ts +22 -20
- package/src/components/dialogs/dev/attribute-write-dialog.ts +10 -4
- package/src/components/dialogs/dev/command-invoke-dialog.ts +13 -9
- package/src/components/dialogs/settings/log-level-section.ts +21 -19
- package/src/components/dialogs/settings/settings-dialog.ts +141 -115
- package/src/components/webrtc-stream-view.ts +30 -22
- package/src/pages/camera-overlay.ts +165 -132
- package/src/pages/cluster-commands/clusters/access-control-commands.ts +47 -37
- package/src/pages/cluster-commands/clusters/avsum-commands.ts +210 -187
- package/src/pages/cluster-commands/clusters/basic-information-commands.ts +5 -3
- package/src/pages/cluster-commands/clusters/binding-commands.ts +40 -36
- package/src/pages/cluster-commands/clusters/chime-commands.ts +84 -52
- package/src/pages/cluster-commands/clusters/closure-control-commands.ts +171 -139
- package/src/pages/cluster-commands/clusters/icd-management-commands.ts +51 -34
- package/src/pages/components/header.ts +62 -50
- package/src/pages/components/node-details.ts +87 -72
- package/src/pages/matter-cluster-view.ts +154 -121
- package/src/pages/matter-endpoint-view.ts +76 -25
- package/src/pages/matter-network-view.ts +36 -30
- package/src/pages/matter-node-view.ts +14 -8
- package/src/pages/matter-server-view.ts +11 -9
- package/src/pages/network/device-panel.ts +20 -18
- package/src/pages/network/network-details.ts +758 -618
- package/src/pages/network/thread-graph.ts +5 -3
- package/src/pages/network/update-connections-dialog.ts +64 -52
- package/src/util/binding.ts +42 -6
- package/src/util/chime.ts +9 -2
- package/src/util/icd.ts +12 -8
- package/src/util/matter-status.ts +26 -0
- package/src/util/node-label.ts +6 -2
- package/src/util/shared-styles.ts +39 -0
|
@@ -1011,9 +1011,11 @@ export class ThreadGraph extends BaseNetworkGraph {
|
|
|
1011
1011
|
<div class="empty-state">
|
|
1012
1012
|
<p>${allOfflineFiltered ? "No online Thread devices" : "No Thread devices found"}</p>
|
|
1013
1013
|
<p class="hint">
|
|
1014
|
-
${
|
|
1015
|
-
|
|
1016
|
-
|
|
1014
|
+
${
|
|
1015
|
+
allOfflineFiltered
|
|
1016
|
+
? 'Disable the "Offline nodes" filter to show offline devices'
|
|
1017
|
+
: "Thread devices will appear here once commissioned"
|
|
1018
|
+
}
|
|
1017
1019
|
</p>
|
|
1018
1020
|
</div>
|
|
1019
1021
|
`;
|
|
@@ -280,60 +280,68 @@ export class UpdateConnectionsDialog extends LitElement {
|
|
|
280
280
|
const plural = neighborCount !== 1 ? "s" : "";
|
|
281
281
|
|
|
282
282
|
return html`
|
|
283
|
-
${
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
283
|
+
${
|
|
284
|
+
sleepy
|
|
285
|
+
? html`
|
|
286
|
+
<p>
|
|
287
|
+
"<strong>${this.selectedNodeName}</strong>" is a sleepy device (Matter LIT). It answers
|
|
288
|
+
only when it next wakes, so its own network data arrives later.
|
|
289
|
+
</p>
|
|
290
|
+
`
|
|
291
|
+
: html`<p>Refresh network information for "<strong>${this.selectedNodeName}</strong>".</p>`
|
|
292
|
+
}
|
|
293
|
+
${
|
|
294
|
+
neighborCount > 0
|
|
295
|
+
? html`
|
|
296
|
+
<label class="checkbox-row">
|
|
297
|
+
<md-checkbox
|
|
298
|
+
?checked=${this._includeNeighbors}
|
|
299
|
+
@change=${this._handleCheckboxChange}
|
|
300
|
+
?disabled=${this._isUpdating}
|
|
301
|
+
></md-checkbox>
|
|
302
|
+
<span
|
|
303
|
+
>${sleepy ? "Refresh" : "Include"} ${neighborCount} connected online
|
|
304
|
+
neighbor${plural}${sleepy ? " for current link data" : ""}</span
|
|
305
|
+
>
|
|
306
|
+
</label>
|
|
307
|
+
`
|
|
308
|
+
: sleepy
|
|
309
|
+
? html`<p class="note">No online neighbor can report its current link data either.</p>`
|
|
310
|
+
: nothing
|
|
311
|
+
}
|
|
308
312
|
`;
|
|
309
313
|
}
|
|
310
314
|
|
|
311
315
|
private _renderOfflineContent(): unknown {
|
|
312
316
|
return html`
|
|
313
317
|
<p>"<strong>${this.selectedNodeName}</strong>" appears to be offline.</p>
|
|
314
|
-
${
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
${
|
|
319
|
+
this.onlineNeighborIds.length > 0
|
|
320
|
+
? html`
|
|
321
|
+
<p>
|
|
322
|
+
Update network data from its ${this.onlineNeighborIds.length} online
|
|
323
|
+
neighbor${this.onlineNeighborIds.length !== 1 ? "s" : ""} to refresh connection info.
|
|
324
|
+
</p>
|
|
325
|
+
`
|
|
326
|
+
: html` <p>No online neighbors available to update.</p> `
|
|
327
|
+
}
|
|
322
328
|
`;
|
|
323
329
|
}
|
|
324
330
|
|
|
325
331
|
private _renderUnknownContent(): unknown {
|
|
326
332
|
return html`
|
|
327
333
|
<p>This device is not commissioned to this fabric and cannot be queried directly.</p>
|
|
328
|
-
${
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
334
|
+
${
|
|
335
|
+
this.onlineNeighborIds.length > 0
|
|
336
|
+
? html`
|
|
337
|
+
<p>
|
|
338
|
+
Update network data from ${this.onlineNeighborIds.length}
|
|
339
|
+
node${this.onlineNeighborIds.length !== 1 ? "s" : ""} that
|
|
340
|
+
see${this.onlineNeighborIds.length === 1 ? "s" : ""} this device to refresh info.
|
|
341
|
+
</p>
|
|
342
|
+
`
|
|
343
|
+
: html` <p>No online nodes available that see this device.</p> `
|
|
344
|
+
}
|
|
337
345
|
`;
|
|
338
346
|
}
|
|
339
347
|
|
|
@@ -364,11 +372,13 @@ export class UpdateConnectionsDialog extends LitElement {
|
|
|
364
372
|
<md-dialog @closed=${this._handleDialogClosed}>
|
|
365
373
|
<div slot="headline">Update Connection Data</div>
|
|
366
374
|
<div slot="content">
|
|
367
|
-
${
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
375
|
+
${
|
|
376
|
+
this.selectedNodeType === "online"
|
|
377
|
+
? this._renderOnlineContent()
|
|
378
|
+
: this.selectedNodeType === "offline"
|
|
379
|
+
? this._renderOfflineContent()
|
|
380
|
+
: this._renderUnknownContent()
|
|
381
|
+
}
|
|
372
382
|
${this._renderLongIdleTimeNote()}
|
|
373
383
|
</div>
|
|
374
384
|
<div slot="actions">
|
|
@@ -377,11 +387,13 @@ export class UpdateConnectionsDialog extends LitElement {
|
|
|
377
387
|
@click=${this._executeUpdate}
|
|
378
388
|
?disabled=${this._isUpdating || this._updateCount === 0}
|
|
379
389
|
>
|
|
380
|
-
${
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
390
|
+
${
|
|
391
|
+
this._isUpdating
|
|
392
|
+
? html`<span class="updating-content"
|
|
393
|
+
>${svg`<svg class="spinner" viewBox="0 0 24 24" width="18" height="18"><path fill="currentColor" d="${mdiLoading}"/></svg>`}Updating...</span
|
|
394
|
+
>`
|
|
395
|
+
: buttonText
|
|
396
|
+
}
|
|
385
397
|
</md-filled-button>
|
|
386
398
|
</div>
|
|
387
399
|
</md-dialog>
|
package/src/util/binding.ts
CHANGED
|
@@ -20,36 +20,56 @@ import {
|
|
|
20
20
|
subjectsInclude,
|
|
21
21
|
} from "./access-control.js";
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
export const BINDING_CLUSTER_ID = 30;
|
|
24
|
+
|
|
25
|
+
const BINDING_KEY_RE = new RegExp(`^(\\d+)/${BINDING_CLUSTER_ID}/0$`);
|
|
24
26
|
|
|
25
27
|
export function readBindings(node: MatterNode, endpoint: number): BindingEntryStruct[] {
|
|
26
|
-
return attributeArray(node.attributes[`${endpoint}/
|
|
28
|
+
return attributeArray(node.attributes[`${endpoint}/${BINDING_CLUSTER_ID}/0`]).map(value =>
|
|
27
29
|
BindingEntryDataTransformer.transform(value),
|
|
28
30
|
);
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
/**
|
|
34
|
+
* The endpoint's binding entries that belong to our fabric, or all of them while the node's
|
|
35
|
+
* CurrentFabricIndex is still uncached. Rendering a binding row uses this so the row set matches
|
|
36
|
+
* what a write's fabric-scoped re-read will act on.
|
|
37
|
+
*/
|
|
38
|
+
export function readOurBindings(node: MatterNode, endpoint: number): BindingEntryStruct[] {
|
|
39
|
+
const fabricIndex = nodeFabricIndex(node);
|
|
40
|
+
return readBindings(node, endpoint).filter(b => fabricIndex === undefined || b.fabricIndex === fabricIndex);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Whether two entries name the same binding target — the identity a delete has to match on. */
|
|
44
|
+
export function sameBindingTarget(a: BindingEntryStruct, b: BindingEntryStruct): boolean {
|
|
45
|
+
const key = (id: number | bigint | undefined) => (id == null ? "" : nodeIdKey(id));
|
|
46
|
+
return key(a.node) === key(b.node) && a.group === b.group && a.endpoint === b.endpoint && a.cluster === b.cluster;
|
|
47
|
+
}
|
|
48
|
+
|
|
31
49
|
export interface EndpointBinding {
|
|
32
50
|
endpoint: number;
|
|
33
51
|
binding: BindingEntryStruct;
|
|
34
52
|
}
|
|
35
53
|
|
|
54
|
+
/** Every endpoint's binding entries of our fabric, on the same terms as {@link readOurBindings}. */
|
|
36
55
|
export function readAllBindings(node: MatterNode): EndpointBinding[] {
|
|
56
|
+
const fabricIndex = nodeFabricIndex(node);
|
|
37
57
|
const result = new Array<EndpointBinding>();
|
|
38
58
|
for (const key of Object.keys(node.attributes)) {
|
|
39
59
|
const m = BINDING_KEY_RE.exec(key);
|
|
40
60
|
if (!m) continue;
|
|
41
61
|
const endpoint = Number(m[1]);
|
|
42
62
|
for (const value of attributeArray(node.attributes[key])) {
|
|
43
|
-
|
|
63
|
+
const binding = BindingEntryDataTransformer.transform(value);
|
|
64
|
+
if (fabricIndex !== undefined && binding.fabricIndex !== fabricIndex) continue;
|
|
65
|
+
result.push({ endpoint, binding });
|
|
44
66
|
}
|
|
45
67
|
}
|
|
46
68
|
return result;
|
|
47
69
|
}
|
|
48
70
|
|
|
49
71
|
function numberList(node: MatterNode, key: string): number[] {
|
|
50
|
-
|
|
51
|
-
if (!Array.isArray(raw)) return new Array<number>();
|
|
52
|
-
return raw.map(v => Number(v));
|
|
72
|
+
return attributeArray(node.attributes[key]).map(v => Number(v));
|
|
53
73
|
}
|
|
54
74
|
|
|
55
75
|
export function targetServerClusters(node: MatterNode, endpoint: number): number[] {
|
|
@@ -60,6 +80,22 @@ export function sourceClientClusters(node: MatterNode, endpoint: number): number
|
|
|
60
80
|
return numberList(node, `${endpoint}/29/2`);
|
|
61
81
|
}
|
|
62
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Client clusters on the endpoint that an existing binding of our fabric already covers.
|
|
85
|
+
*
|
|
86
|
+
* Per the Binding cluster spec an entry with no Cluster field covers every client cluster on the
|
|
87
|
+
* endpoint — whole-endpoint unicast and group bindings both take that form. The fabric filter keeps
|
|
88
|
+
* the result correct even if a caller ever populates the cache from an unfiltered read.
|
|
89
|
+
*/
|
|
90
|
+
export function boundClientClusterIds(node: MatterNode, endpoint: number): Set<number> {
|
|
91
|
+
const bindings = readOurBindings(node, endpoint);
|
|
92
|
+
const bound = new Set(bindings.map(b => b.cluster).filter((c): c is number => c !== undefined));
|
|
93
|
+
if (bindings.some(b => b.cluster === undefined && (b.group !== undefined || b.endpoint !== undefined))) {
|
|
94
|
+
for (const cluster of sourceClientClusters(node, endpoint)) bound.add(cluster);
|
|
95
|
+
}
|
|
96
|
+
return bound;
|
|
97
|
+
}
|
|
98
|
+
|
|
63
99
|
export interface BindableClusters {
|
|
64
100
|
bindable: number[];
|
|
65
101
|
otherTarget: number[];
|
package/src/util/chime.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import type { MatterClient, MatterNode } from "@matter-server/ws-client";
|
|
8
8
|
import { asObject, pickNumber, pickString } from "./attribute-shapes.js";
|
|
9
|
+
import { requireAttributeWriteSuccess } from "./matter-status.js";
|
|
9
10
|
|
|
10
11
|
/** Chime cluster (Matter spec). */
|
|
11
12
|
export const CHIME_CLUSTER_ID = 1366; // 0x0556
|
|
@@ -59,7 +60,10 @@ export async function setEnabled(
|
|
|
59
60
|
endpoint: number,
|
|
60
61
|
enabled: boolean,
|
|
61
62
|
): Promise<void> {
|
|
62
|
-
|
|
63
|
+
requireAttributeWriteSuccess(
|
|
64
|
+
await client.writeAttribute(nodeId, `${endpoint}/${CHIME_CLUSTER_ID}/${ATTR_ENABLED}`, enabled),
|
|
65
|
+
"Writing the Chime Enabled attribute failed",
|
|
66
|
+
);
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
export async function setSelected(
|
|
@@ -68,7 +72,10 @@ export async function setSelected(
|
|
|
68
72
|
endpoint: number,
|
|
69
73
|
chimeId: number,
|
|
70
74
|
): Promise<void> {
|
|
71
|
-
|
|
75
|
+
requireAttributeWriteSuccess(
|
|
76
|
+
await client.writeAttribute(nodeId, `${endpoint}/${CHIME_CLUSTER_ID}/${ATTR_SELECTED_CHIME}`, chimeId),
|
|
77
|
+
"Writing the selected chime failed",
|
|
78
|
+
);
|
|
72
79
|
}
|
|
73
80
|
|
|
74
81
|
export async function play(
|
package/src/util/icd.ts
CHANGED
|
@@ -17,9 +17,13 @@ export interface IcdFeatures {
|
|
|
17
17
|
dynamicSitLitSupport: boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* A registration on the device. Everything but FabricIndex is fabric-sensitive, so an entry another
|
|
22
|
+
* fabric owns arrives from an unfiltered read carrying only its FabricIndex.
|
|
23
|
+
*/
|
|
20
24
|
export interface IcdRegisteredClient {
|
|
21
|
-
checkInNodeId: number | bigint;
|
|
22
|
-
monitoredSubject: number | bigint;
|
|
25
|
+
checkInNodeId: number | bigint | undefined;
|
|
26
|
+
monitoredSubject: number | bigint | undefined;
|
|
23
27
|
fabricIndex: number;
|
|
24
28
|
}
|
|
25
29
|
|
|
@@ -62,13 +66,13 @@ function nodeOrSubjectId(value: unknown): number | bigint | undefined {
|
|
|
62
66
|
|
|
63
67
|
function decodeRegisteredClient(entry: unknown): IcdRegisteredClient | undefined {
|
|
64
68
|
if (!isRecord(entry)) return undefined;
|
|
65
|
-
const checkInNodeId = nodeOrSubjectId(entry["1"]);
|
|
66
|
-
const monitoredSubject = nodeOrSubjectId(entry["2"]);
|
|
67
69
|
const fabricIndex = entry["254"];
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
if (typeof fabricIndex !== "number") return undefined;
|
|
71
|
+
return {
|
|
72
|
+
checkInNodeId: nodeOrSubjectId(entry["1"]),
|
|
73
|
+
monitoredSubject: nodeOrSubjectId(entry["2"]),
|
|
74
|
+
fabricIndex,
|
|
75
|
+
};
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
/** MonitoringRegistrationStruct wire entries are field-tag keyed: "1" CheckInNodeId, "2" MonitoredSubject, "254" FabricIndex. */
|
|
@@ -135,6 +135,32 @@ export function analyzeBatchResults(results: Array<{ status: number }> | null |
|
|
|
135
135
|
return { outcome, successCount, failureCount, errorCounts, message };
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
/**
|
|
139
|
+
* Throw unless every write in the batch succeeded. A device-side status is reported in the response
|
|
140
|
+
* rather than thrown, so without this a rejected write reports success to the user.
|
|
141
|
+
*/
|
|
142
|
+
export function requireWriteSuccess(results: Array<{ status: number }> | null | undefined, what: string): void {
|
|
143
|
+
const batch = analyzeBatchResults(results);
|
|
144
|
+
if (batch.outcome === "all_success") return;
|
|
145
|
+
// A whole-list attribute write reports one result for the list, so batch phrasing ("1 of N
|
|
146
|
+
// entries failed") would suggest the other entries landed. Nothing landed.
|
|
147
|
+
if (results?.length === 1) {
|
|
148
|
+
throw new Error(`${what}: ${getMatterStatusName(results[0].status)} (${results[0].status})`);
|
|
149
|
+
}
|
|
150
|
+
throw new Error(`${what}: ${batch.message}`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** `write_attribute` keys its result in the Python Matter Server casing, unlike the other write commands. */
|
|
154
|
+
export function requireAttributeWriteSuccess(
|
|
155
|
+
results: Array<{ Status: number }> | null | undefined,
|
|
156
|
+
what: string,
|
|
157
|
+
): void {
|
|
158
|
+
requireWriteSuccess(
|
|
159
|
+
results?.map(result => ({ status: result.Status })),
|
|
160
|
+
what,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
138
164
|
/** Format a human-readable message for batch results */
|
|
139
165
|
function formatBatchMessage(
|
|
140
166
|
outcome: BatchOutcome,
|
package/src/util/node-label.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { MatterClient, MatterNode } from "@matter-server/ws-client";
|
|
8
|
+
import { requireAttributeWriteSuccess } from "./matter-status.js";
|
|
8
9
|
|
|
9
10
|
// BasicInformation cluster (0x28 / 40), always on endpoint 0 per Matter specification.
|
|
10
11
|
export const NODE_LABEL_CLUSTER_ID = 0x28;
|
|
@@ -17,6 +18,9 @@ export const NODE_LABEL_ATTRIBUTE_PATH = `0/${NODE_LABEL_CLUSTER_ID}/${NODE_LABE
|
|
|
17
18
|
* Write the BasicInformation NodeLabel attribute for a node.
|
|
18
19
|
* Trims surrounding whitespace so the stored value matches what MatterNode.nodeLabel reads back.
|
|
19
20
|
*/
|
|
20
|
-
export function writeNodeLabel(client: MatterClient, node: MatterNode, label: string): Promise<
|
|
21
|
-
|
|
21
|
+
export async function writeNodeLabel(client: MatterClient, node: MatterNode, label: string): Promise<void> {
|
|
22
|
+
requireAttributeWriteSuccess(
|
|
23
|
+
await client.writeAttribute(node.node_id, NODE_LABEL_ATTRIBUTE_PATH, label.trim()),
|
|
24
|
+
"Writing the node label failed",
|
|
25
|
+
);
|
|
22
26
|
}
|
|
@@ -34,6 +34,45 @@ export const reducedMotionStyles = css`
|
|
|
34
34
|
}
|
|
35
35
|
`;
|
|
36
36
|
|
|
37
|
+
/** Bordered panel holding one or more `.info-section` blocks, each optionally listing `.chip`s. */
|
|
38
|
+
export const infoPanelStyles = css`
|
|
39
|
+
.info-panel {
|
|
40
|
+
background-color: var(--md-sys-color-surface-container);
|
|
41
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
42
|
+
border-radius: 12px;
|
|
43
|
+
padding: 14px 16px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.info-section + .info-section {
|
|
47
|
+
margin-top: 12px;
|
|
48
|
+
padding-top: 12px;
|
|
49
|
+
border-top: 1px solid var(--md-sys-color-outline-variant);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.info-section-header {
|
|
53
|
+
font-weight: 500;
|
|
54
|
+
color: var(--md-sys-color-on-surface);
|
|
55
|
+
margin-bottom: 10px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.chip-list {
|
|
59
|
+
list-style: none;
|
|
60
|
+
margin: 0;
|
|
61
|
+
padding: 0;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-wrap: wrap;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.chip {
|
|
68
|
+
font-size: 0.85rem;
|
|
69
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
70
|
+
background: var(--md-sys-color-secondary-container);
|
|
71
|
+
padding: 4px 10px;
|
|
72
|
+
border-radius: 8px;
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
|
|
37
76
|
export const notFoundStyles = css`
|
|
38
77
|
.not-found {
|
|
39
78
|
display: flex;
|