Skip to content

Commit

Permalink
fix: Fix transactionSequenceNumber not logged with readResponse (#981)
Browse files Browse the repository at this point in the history
* fix: Fix `transactionSequenceNumber` not logged with readResponse

* fix
  • Loading branch information
Koenkk authored Mar 17, 2024
1 parent f0b7f43 commit 778cbad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controller/model/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ class Endpoint extends Entity {
);

const log = `ReadResponse ${this.deviceIeeeAddress}/${this.ID} ` +
`${cluster.name}(${JSON.stringify(attributes)}, ${JSON.stringify(options)})`;
`${cluster.name}(${JSON.stringify(attributes)}, ${JSON.stringify({...options, transactionSequenceNumber})})`;
debug.info(log);

try {
Expand Down
2 changes: 1 addition & 1 deletion test/controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4048,7 +4048,7 @@ describe('Controller', () => {
mocksendZclFrameToEndpoint.mockRejectedValueOnce(new Error('timeout occurred'));
let error;
try {await endpoint.readResponse('genOnOff', 1, [{onOff: 1}])} catch (e) {error = e}
expect(error).toStrictEqual(new Error(`ReadResponse 0x129/1 genOnOff([{"onOff":1}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (timeout occurred)`));
expect(error).toStrictEqual(new Error(`ReadResponse 0x129/1 genOnOff([{"onOff":1}], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":1,"writeUndiv":false}) failed (timeout occurred)`));
});

it('Read error', async () => {
Expand Down

0 comments on commit 778cbad

Please sign in to comment.