Skip to content

Commit 285ab50

Browse files
authored
Dashboard: Fallback for unknown endpoint device types (#1303)
1 parent 16cca61 commit 285ab50

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

dashboard/src/pages/matter-endpoint-view.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ function getUniqueClusters(node: MatterNode, endpoint: Number) {
2727
export function getEndpointDeviceTypes(node: MatterNode, endpoint: Number): DeviceType[] {
2828
const rawValues: Record<string, number>[] | undefined = node.attributes[`${endpoint}/29/0`];
2929
if (!rawValues) return [];
30-
return rawValues.map((rawValue) => { return device_types[rawValue["0"] || rawValue["deviceType"]] })
30+
return rawValues.map((rawValue) => {
31+
const id = rawValue["0"] ?? rawValue["deviceType"];
32+
return device_types[id] || { id: id ?? -1, label: `Unknown Device Type (${id})`, clusters: [] };
33+
});
3134
}
3235

3336
@customElement("matter-endpoint-view")

0 commit comments

Comments
 (0)