Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 102 additions & 102 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
]
},
"devDependencies": {
"@matter/main": "^0.13.0",
"@matter/main": "^0.16.10",
"apidoc": "^1.0.3",
"chai": "^4.3.7",
"chai-as-promised": "^7.1.1",
Expand Down
10 changes: 6 additions & 4 deletions server/services/matter/lib/matter.getNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const convertDevice = (device) => {
const clusterClients = [];

// Each cluster client is a feature of the device
device.clusterClients.forEach((clusterClient, clusterIndex) => {
const allClusterClients = device.getAllClusterClients();
allClusterClients.forEach((clusterClient) => {
clusterClients.push({
id: clusterClient.id.toString(),
name: clusterClient.name,
Expand All @@ -16,7 +17,8 @@ const convertDevice = (device) => {
});

// Convert child endpoints (child devices)
const childEndpoints = device.childEndpoints.map((childDeviceEndpoint) => {
const childEndpointsList = device.getChildEndpoints();
const childEndpoints = childEndpointsList.map((childDeviceEndpoint) => {
return convertDevice(childDeviceEndpoint);
});

Expand All @@ -37,8 +39,8 @@ const convertDevice = (device) => {
async function getNodes() {
const nodeDetails = this.commissioningController.getCommissionedNodesDetails();
const filteredNodeDetails = nodeDetails.filter((nodeDetail) => {
if (!nodeDetail.deviceData) {
logger.warn(`Matter: Node ${nodeDetail.nodeId} has no device data`);
if (!nodeDetail.deviceData || !nodeDetail.deviceData.basicInformation) {
logger.warn(`Matter: Node ${nodeDetail.nodeId} has no device data or basic information`);
return false;
}
return true;
Expand Down
7 changes: 4 additions & 3 deletions server/services/matter/lib/matter.handleNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const handleDevice = async (
};

// If we have this cluster, it means we are in a bridge device
const bridgedDeviceBasicInformationClusterClient = device.clusterClients.get(
const bridgedDeviceBasicInformationClusterClient = device.getClusterClientById(
BridgedDeviceBasicInformation.Complete.id,
);

Expand Down Expand Up @@ -82,8 +82,9 @@ const handleDevice = async (
devices.push(gladysDevice);
}

if (device.childEndpoints) {
await Promise.each(device.childEndpoints, async (childDevice, index) => {
const childEndpoints = device.getChildEndpoints();
if (childEndpoints && childEndpoints.length > 0) {
await Promise.each(childEndpoints, async (childDevice, index) => {
await handleDevice(
nodeId,
childInformations,
Expand Down
Loading
Loading