-
-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only expose currentValue on devices that use Basic CC for reporting
- Loading branch information
Showing
8 changed files
with
134 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
46 changes: 46 additions & 0 deletions
46
packages/zwave-js/src/lib/test/compat/basicCCSupportWhenForbidden.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,46 @@ | ||
import { BasicCCValues } from "@zwave-js/cc"; | ||
import { CommandClasses } from "@zwave-js/core"; | ||
import { integrationTest } from "../integrationTestSuite"; | ||
|
||
integrationTest( | ||
"On devices that MUST not support Basic CC, but use Basic Set to report status, ONLY currentValue should be exposed", | ||
{ | ||
debug: true, | ||
|
||
nodeCapabilities: { | ||
// Routing Multilevel Sensor, MUST not support Basic CC | ||
genericDeviceClass: 0x21, | ||
specificDeviceClass: 0x01, | ||
commandClasses: [ | ||
CommandClasses.Version, | ||
// But it reports support if asked | ||
CommandClasses.Basic, | ||
], | ||
}, | ||
|
||
async testBody(t, driver, node, mockController, mockNode) { | ||
const valueIDs = node.getDefinedValueIDs(); | ||
t.true( | ||
valueIDs.some((v) => BasicCCValues.currentValue.is(v)), | ||
"Did not find Basic CC currentValue although it should be exposed", | ||
); | ||
t.false( | ||
valueIDs.some((v) => BasicCCValues.targetValue.is(v)), | ||
"Found Basic CC targetValue although it shouldn't be exposed", | ||
); | ||
t.false( | ||
valueIDs.some((v) => BasicCCValues.duration.is(v)), | ||
"Found Basic CC duration although it shouldn't be exposed", | ||
); | ||
t.false( | ||
valueIDs.some((v) => BasicCCValues.restorePrevious.is(v)), | ||
"Found Basic CC restorePrevious although it shouldn't be exposed", | ||
); | ||
|
||
t.false( | ||
valueIDs.some((v) => BasicCCValues.compatEvent.is(v)), | ||
"Found Basic CC compatEvent although it shouldn't be exposed", | ||
); | ||
}, | ||
}, | ||
); |