-
-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: parsing of BridgeApplicationCommandRequest w/o RSSI (#4337)
- Loading branch information
Showing
2 changed files
with
57 additions
and
12 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
packages/zwave-js/src/lib/controller/BridgeApplicationCommandRequest.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ConfigManager } from "@zwave-js/config"; | ||
import "../commandclass/index"; | ||
import type { Driver } from "../driver/Driver"; | ||
import { Message } from "../message/Message"; | ||
import { createEmptyMockDriver } from "../test/mocks"; | ||
|
||
const fakeDriver = createEmptyMockDriver() as unknown as Driver; | ||
|
||
describe("BridgeApplicationCommandRequest", () => { | ||
beforeAll(async () => { | ||
const configManager = new ConfigManager(); | ||
await configManager.loadMeters(); | ||
(fakeDriver as any).configManager = configManager; | ||
(fakeDriver as any).controller = { | ||
ownNodeId: 1, | ||
nodes: { | ||
get() { | ||
return { | ||
valueDB: { | ||
hasMetadata: () => false, | ||
setMetadata() {}, | ||
getMetadata() {}, | ||
setValue() {}, | ||
getValue() {}, | ||
}, | ||
isCCSecure: () => true, | ||
getEndpoint() {}, | ||
}; | ||
}, | ||
}, | ||
}; | ||
}); | ||
|
||
describe("regression tests", () => { | ||
it("parsing without RSSI", async () => { | ||
// Repro for https://github.com/zwave-js/node-zwave-js/issues/4335 | ||
Message.from( | ||
fakeDriver, | ||
Buffer.from("011200a80001020a320221340000000000000069", "hex"), | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters