From 31cbea625001c82818fbe1d8cb6b6c33fe24dd3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 11 Dec 2025 10:47:27 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Fallback=20for=20unknown=20endpoint=20devic?= =?UTF-8?q?e=20types=20so=20the=20dashboard=20renders=20instead=20of=20err?= =?UTF-8?q?oring=20and=20shows=20=E2=80=9CUnknown=20Device=20Type=E2=80=9D?= =?UTF-8?q?=20when=20no=20description=20is=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/src/pages/matter-endpoint-view.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard/src/pages/matter-endpoint-view.ts b/dashboard/src/pages/matter-endpoint-view.ts index 09953e2b..1bf5bb39 100644 --- a/dashboard/src/pages/matter-endpoint-view.ts +++ b/dashboard/src/pages/matter-endpoint-view.ts @@ -27,7 +27,10 @@ function getUniqueClusters(node: MatterNode, endpoint: Number) { export function getEndpointDeviceTypes(node: MatterNode, endpoint: Number): DeviceType[] { const rawValues: Record[] | undefined = node.attributes[`${endpoint}/29/0`]; if (!rawValues) return []; - return rawValues.map((rawValue) => { return device_types[rawValue["0"] || rawValue["deviceType"]] }) + return rawValues.map((rawValue) => { + const id = rawValue["0"] ?? rawValue["deviceType"]; + return device_types[id] || { id: id ?? -1, label: "Unknown Device Type", clusters: [] }; + }); } @customElement("matter-endpoint-view") From 209c8f8fa5c14635030eae834795d44f21aa4c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Thu, 11 Dec 2025 11:18:43 +0000 Subject: [PATCH 2/2] Update label for unknown device types to include ID in getEndpointDeviceTypes --- dashboard/src/pages/matter-endpoint-view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/src/pages/matter-endpoint-view.ts b/dashboard/src/pages/matter-endpoint-view.ts index 1bf5bb39..f96b6436 100644 --- a/dashboard/src/pages/matter-endpoint-view.ts +++ b/dashboard/src/pages/matter-endpoint-view.ts @@ -29,7 +29,7 @@ export function getEndpointDeviceTypes(node: MatterNode, endpoint: Number): Devi if (!rawValues) return []; return rawValues.map((rawValue) => { const id = rawValue["0"] ?? rawValue["deviceType"]; - return device_types[id] || { id: id ?? -1, label: "Unknown Device Type", clusters: [] }; + return device_types[id] || { id: id ?? -1, label: `Unknown Device Type (${id})`, clusters: [] }; }); }