Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.7.1 #201

Merged
merged 15 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add local attribute value handling in wsMessageHandler for improved l…
…ogging
  • Loading branch information
Luligu committed Jan 7, 2025
commit e8931df2015eb6fda2675d6f25cd8575dc2d27a7
8 changes: 8 additions & 0 deletions src/matterbridgeWebsocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,14 @@ export async function wsMessageHandler(this: Matterbridge, client: WebSocket, me
});
}
let attributeValue;
let attributeLocalValue;
try {
if (typeof value.getLocal() === 'object') attributeValue = stringify(value.getLocal());
else attributeValue = value.getLocal().toString();
attributeLocalValue = value.getLocal();
} catch (error) {
attributeValue = 'Fabric-Scoped';
attributeLocalValue = 'Fabric-Scoped';
this.log.debug(`GetLocal value ${error} in clusterServer: ${clusterServer.name}(${clusterServer.id}) attribute: ${key}(${value.id})`);
}
clusters.push({
Expand All @@ -226,6 +229,7 @@ export async function wsMessageHandler(this: Matterbridge, client: WebSocket, me
attributeName: key,
attributeId: '0x' + value.id.toString(16).padStart(2, '0'),
attributeValue,
attributeLocalValue,
});
});
});
Expand All @@ -243,11 +247,14 @@ export async function wsMessageHandler(this: Matterbridge, client: WebSocket, me
});
}
let attributeValue;
let attributeLocalValue;
try {
if (typeof value.getLocal() === 'object') attributeValue = stringify(value.getLocal());
else attributeValue = value.getLocal().toString();
attributeLocalValue = value.getLocal();
} catch (error) {
attributeValue = 'Fabric-Scoped';
attributeLocalValue = 'Fabric-Scoped';
this.log.debug(`GetLocal error ${error} in clusterServer: ${clusterServer.name}(${clusterServer.id}) attribute: ${key}(${value.id})`);
}
clusters.push({
Expand All @@ -259,6 +266,7 @@ export async function wsMessageHandler(this: Matterbridge, client: WebSocket, me
attributeName: key,
attributeId: '0x' + value.id.toString(16).padStart(2, '0'),
attributeValue,
attributeLocalValue,
});
});
});
Expand Down