zwave-js 15.23.0 → 15.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/build/cjs/Node.d.ts +3 -1
  2. package/build/cjs/Node.js +6 -0
  3. package/build/cjs/Node.js.map +2 -2
  4. package/build/cjs/lib/_version.d.ts +1 -1
  5. package/build/cjs/lib/_version.js +1 -1
  6. package/build/cjs/lib/_version.js.map +1 -1
  7. package/build/cjs/lib/node/MockNodeBehaviors.js +4 -0
  8. package/build/cjs/lib/node/MockNodeBehaviors.js.map +2 -2
  9. package/build/cjs/lib/node/_Types.d.ts +1 -1
  10. package/build/cjs/lib/node/_Types.js.map +1 -1
  11. package/build/cjs/lib/node/endpoint-mixins/index.d.ts +12 -2
  12. package/build/cjs/lib/node/endpoint-mixins/index.js +26 -4
  13. package/build/cjs/lib/node/endpoint-mixins/index.js.map +2 -2
  14. package/build/cjs/lib/node/{endpoint-mixins/05_AccessControl.d.ts → feature-apis/AccessControl.d.ts} +7 -49
  15. package/build/cjs/lib/node/{endpoint-mixins/05_AccessControl.js → feature-apis/AccessControl.js} +237 -185
  16. package/build/cjs/lib/node/feature-apis/AccessControl.js.map +7 -0
  17. package/build/cjs/lib/node/feature-apis/FeatureAPI.d.ts +12 -0
  18. package/build/cjs/lib/node/feature-apis/FeatureAPI.js +41 -0
  19. package/build/cjs/lib/node/feature-apis/FeatureAPI.js.map +7 -0
  20. package/build/cjs/lib/node/mockCCBehaviors/DoorLock.d.ts +3 -0
  21. package/build/cjs/lib/node/mockCCBehaviors/DoorLock.js +232 -0
  22. package/build/cjs/lib/node/mockCCBehaviors/DoorLock.js.map +7 -0
  23. package/build/cjs/lib/node/mockCCBehaviors/Lock.d.ts +3 -0
  24. package/build/cjs/lib/node/mockCCBehaviors/Lock.js +116 -0
  25. package/build/cjs/lib/node/mockCCBehaviors/Lock.js.map +7 -0
  26. package/build/esm/Node.d.ts +3 -1
  27. package/build/esm/Node.d.ts.map +1 -1
  28. package/build/esm/Node.js +2 -0
  29. package/build/esm/Node.js.map +1 -1
  30. package/build/esm/lib/_version.d.ts +1 -1
  31. package/build/esm/lib/_version.js +1 -1
  32. package/build/esm/lib/node/MockNodeBehaviors.d.ts.map +1 -1
  33. package/build/esm/lib/node/MockNodeBehaviors.js +4 -0
  34. package/build/esm/lib/node/MockNodeBehaviors.js.map +1 -1
  35. package/build/esm/lib/node/_Types.d.ts +1 -1
  36. package/build/esm/lib/node/_Types.d.ts.map +1 -1
  37. package/build/esm/lib/node/endpoint-mixins/index.d.ts +12 -2
  38. package/build/esm/lib/node/endpoint-mixins/index.d.ts.map +1 -1
  39. package/build/esm/lib/node/endpoint-mixins/index.js +20 -2
  40. package/build/esm/lib/node/endpoint-mixins/index.js.map +1 -1
  41. package/build/esm/lib/node/{endpoint-mixins/05_AccessControl.d.ts → feature-apis/AccessControl.d.ts} +7 -49
  42. package/build/esm/lib/node/feature-apis/AccessControl.d.ts.map +1 -0
  43. package/build/esm/lib/node/{endpoint-mixins/05_AccessControl.js → feature-apis/AccessControl.js} +239 -186
  44. package/build/esm/lib/node/feature-apis/AccessControl.js.map +1 -0
  45. package/build/esm/lib/node/feature-apis/FeatureAPI.d.ts +12 -0
  46. package/build/esm/lib/node/feature-apis/FeatureAPI.d.ts.map +1 -0
  47. package/build/esm/lib/node/feature-apis/FeatureAPI.js +14 -0
  48. package/build/esm/lib/node/feature-apis/FeatureAPI.js.map +1 -0
  49. package/build/esm/lib/node/mockCCBehaviors/DoorLock.d.ts +3 -0
  50. package/build/esm/lib/node/mockCCBehaviors/DoorLock.d.ts.map +1 -0
  51. package/build/esm/lib/node/mockCCBehaviors/DoorLock.js +211 -0
  52. package/build/esm/lib/node/mockCCBehaviors/DoorLock.js.map +1 -0
  53. package/build/esm/lib/node/mockCCBehaviors/Lock.d.ts +3 -0
  54. package/build/esm/lib/node/mockCCBehaviors/Lock.d.ts.map +1 -0
  55. package/build/esm/lib/node/mockCCBehaviors/Lock.js +91 -0
  56. package/build/esm/lib/node/mockCCBehaviors/Lock.js.map +1 -0
  57. package/package.json +9 -9
  58. package/build/cjs/lib/node/endpoint-mixins/05_AccessControl.js.map +0 -7
  59. package/build/esm/lib/node/endpoint-mixins/05_AccessControl.d.ts.map +0 -1
  60. package/build/esm/lib/node/endpoint-mixins/05_AccessControl.js.map +0 -1
@@ -9,5 +9,7 @@ export { VirtualEndpoint } from "./lib/node/VirtualEndpoint.js";
9
9
  export { VirtualNode } from "./lib/node/VirtualNode.js";
10
10
  export type { VirtualValueID } from "./lib/node/VirtualNode.js";
11
11
  export * from "./lib/node/_Types.js";
12
- export type { CredentialCapabilities, CredentialData, SetUserOptions, UserCapabilities, UserData, } from "./lib/node/endpoint-mixins/05_AccessControl.js";
12
+ export { AccessControlAPI } from "./lib/node/feature-apis/AccessControl.js";
13
+ export type { CredentialCapabilities, CredentialData, SetUserOptions, UserCapabilities, UserData, } from "./lib/node/feature-apis/AccessControl.js";
14
+ export { FeatureAPI } from "./lib/node/feature-apis/FeatureAPI.js";
13
15
  //# sourceMappingURL=Node.d.ts.map
package/build/cjs/Node.js CHANGED
@@ -19,8 +19,10 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
  var Node_exports = {};
21
21
  __export(Node_exports, {
22
+ AccessControlAPI: () => import_AccessControl.AccessControlAPI,
22
23
  DeviceClass: () => import_DeviceClass.DeviceClass,
23
24
  Endpoint: () => import_Endpoint.Endpoint,
25
+ FeatureAPI: () => import_FeatureAPI.FeatureAPI,
24
26
  NODE_ID_BROADCAST: () => import_core.NODE_ID_BROADCAST,
25
27
  NODE_ID_BROADCAST_LR: () => import_core.NODE_ID_BROADCAST_LR,
26
28
  NODE_ID_MAX: () => import_core.NODE_ID_MAX,
@@ -39,10 +41,14 @@ var import_Node = require("./lib/node/Node.js");
39
41
  var import_VirtualEndpoint = require("./lib/node/VirtualEndpoint.js");
40
42
  var import_VirtualNode = require("./lib/node/VirtualNode.js");
41
43
  __reExport(Node_exports, require("./lib/node/_Types.js"), module.exports);
44
+ var import_AccessControl = require("./lib/node/feature-apis/AccessControl.js");
45
+ var import_FeatureAPI = require("./lib/node/feature-apis/FeatureAPI.js");
42
46
  // Annotate the CommonJS export names for ESM import in node:
43
47
  0 && (module.exports = {
48
+ AccessControlAPI,
44
49
  DeviceClass,
45
50
  Endpoint,
51
+ FeatureAPI,
46
52
  NODE_ID_BROADCAST,
47
53
  NODE_ID_BROADCAST_LR,
48
54
  NODE_ID_MAX,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Node.ts"],
4
- "sourcesContent": ["export {\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\tNODE_ID_MAX,\n\tNodeType,\n\tProtocolDataRate,\n\tProtocolVersion,\n} from \"@zwave-js/core\";\nexport type { DataRate, FLiRS } from \"@zwave-js/core\";\nexport { DeviceClass } from \"./lib/node/DeviceClass.js\";\nexport type { NodeDump } from \"./lib/node/Dump.js\";\nexport { Endpoint } from \"./lib/node/Endpoint.js\";\nexport { ZWaveNode } from \"./lib/node/Node.js\";\nexport type {\n\tNodeStatistics,\n\tRouteStatistics,\n} from \"./lib/node/NodeStatistics.js\";\nexport { VirtualEndpoint } from \"./lib/node/VirtualEndpoint.js\";\nexport { VirtualNode } from \"./lib/node/VirtualNode.js\";\nexport type { VirtualValueID } from \"./lib/node/VirtualNode.js\";\nexport * from \"./lib/node/_Types.js\";\nexport type {\n\tCredentialCapabilities,\n\tCredentialData,\n\tSetUserOptions,\n\tUserCapabilities,\n\tUserData,\n} from \"./lib/node/endpoint-mixins/05_AccessControl.js\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAAA,kBAOO;AAEP,yBAA4B;AAE5B,sBAAyB;AACzB,kBAA0B;AAK1B,6BAAgC;AAChC,yBAA4B;AAE5B,yBAAc,iCApBd;",
4
+ "sourcesContent": ["export {\n\tNODE_ID_BROADCAST,\n\tNODE_ID_BROADCAST_LR,\n\tNODE_ID_MAX,\n\tNodeType,\n\tProtocolDataRate,\n\tProtocolVersion,\n} from \"@zwave-js/core\";\nexport type { DataRate, FLiRS } from \"@zwave-js/core\";\nexport { DeviceClass } from \"./lib/node/DeviceClass.js\";\nexport type { NodeDump } from \"./lib/node/Dump.js\";\nexport { Endpoint } from \"./lib/node/Endpoint.js\";\nexport { ZWaveNode } from \"./lib/node/Node.js\";\nexport type {\n\tNodeStatistics,\n\tRouteStatistics,\n} from \"./lib/node/NodeStatistics.js\";\nexport { VirtualEndpoint } from \"./lib/node/VirtualEndpoint.js\";\nexport { VirtualNode } from \"./lib/node/VirtualNode.js\";\nexport type { VirtualValueID } from \"./lib/node/VirtualNode.js\";\nexport * from \"./lib/node/_Types.js\";\nexport { AccessControlAPI } from \"./lib/node/feature-apis/AccessControl.js\";\nexport type {\n\tCredentialCapabilities,\n\tCredentialData,\n\tSetUserOptions,\n\tUserCapabilities,\n\tUserData,\n} from \"./lib/node/feature-apis/AccessControl.js\";\nexport { FeatureAPI } from \"./lib/node/feature-apis/FeatureAPI.js\";\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;AAAA,kBAOO;AAEP,yBAA4B;AAE5B,sBAAyB;AACzB,kBAA0B;AAK1B,6BAAgC;AAChC,yBAA4B;AAE5B,yBAAc,iCApBd;AAqBA,2BAAiC;AAQjC,wBAA2B;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,3 @@
1
- export declare const PACKAGE_VERSION = "15.23.0";
1
+ export declare const PACKAGE_VERSION = "15.23.2";
2
2
  export declare const PACKAGE_NAME = "zwave-js";
3
3
  //# sourceMappingURL=_version.d.ts.map
@@ -22,7 +22,7 @@ __export(version_exports, {
22
22
  PACKAGE_VERSION: () => PACKAGE_VERSION
23
23
  });
24
24
  module.exports = __toCommonJS(version_exports);
25
- const PACKAGE_VERSION = "15.23.0";
25
+ const PACKAGE_VERSION = "15.23.2";
26
26
  const PACKAGE_NAME = "zwave-js";
27
27
  // Annotate the CommonJS export names for ESM import in node:
28
28
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/_version.ts"],
4
- "sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"15.23.0\";\nexport const PACKAGE_NAME = \"zwave-js\";\n"],
4
+ "sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"15.23.2\";\nexport const PACKAGE_NAME = \"zwave-js\";\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;;AACO,MAAM,kBAAkB;AACxB,MAAM,eAAe;",
6
6
  "names": []
7
7
  }
@@ -31,8 +31,10 @@ var import_BinarySensor = require("./mockCCBehaviors/BinarySensor.js");
31
31
  var import_BinarySwitch = require("./mockCCBehaviors/BinarySwitch.js");
32
32
  var import_ColorSwitch = require("./mockCCBehaviors/ColorSwitch.js");
33
33
  var import_Configuration = require("./mockCCBehaviors/Configuration.js");
34
+ var import_DoorLock = require("./mockCCBehaviors/DoorLock.js");
34
35
  var import_EnergyProduction = require("./mockCCBehaviors/EnergyProduction.js");
35
36
  var import_Indicator = require("./mockCCBehaviors/Indicator.js");
37
+ var import_Lock = require("./mockCCBehaviors/Lock.js");
36
38
  var import_ManufacturerSpecific = require("./mockCCBehaviors/ManufacturerSpecific.js");
37
39
  var import_Meter = require("./mockCCBehaviors/Meter.js");
38
40
  var import_MultiChannel = require("./mockCCBehaviors/MultiChannel.js");
@@ -167,7 +169,9 @@ function createDefaultBehaviors() {
167
169
  ...import_BinarySwitch.BinarySwitchCCBehaviors,
168
170
  ...import_ColorSwitch.ColorSwitchCCBehaviors,
169
171
  ...import_Configuration.ConfigurationCCBehaviors,
172
+ ...import_DoorLock.DoorLockCCBehaviors,
170
173
  ...import_EnergyProduction.EnergyProductionCCBehaviors,
174
+ ...import_Lock.LockCCBehaviors,
171
175
  ...import_Indicator.IndicatorCCBehaviors,
172
176
  ...import_ManufacturerSpecific.ManufacturerSpecificCCBehaviors,
173
177
  ...import_Meter.MeterCCBehaviors,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/node/MockNodeBehaviors.ts"],
4
- "sourcesContent": ["import {\n\ttype CommandClass,\n\tSecurity2CC,\n\tSecurity2CCMessageEncapsulation,\n\tVersionCCCapabilitiesGet,\n\tVersionCCCapabilitiesReport,\n\tVersionCCCommandClassGet,\n\tVersionCCCommandClassReport,\n\tVersionCCGet,\n\tVersionCCReport,\n\tZWavePlusNodeType,\n\tZWavePlusRoleType,\n} from \"@zwave-js/cc\";\nimport { ZWavePlusCCGet, ZWavePlusCCReport } from \"@zwave-js/cc/ZWavePlusCC\";\nimport {\n\tZWaveProtocolCCNodeInformationFrame,\n\tZWaveProtocolCCRequestNodeInformationFrame,\n} from \"@zwave-js/cc/ZWaveProtocolCC\";\nimport { CommandClasses, ZWaveLibraryTypes } from \"@zwave-js/core\";\nimport type { MockNodeBehavior } from \"@zwave-js/testing\";\n\nimport { BasicCCBehaviors } from \"./mockCCBehaviors/Basic.js\";\nimport { BinarySensorCCBehaviors } from \"./mockCCBehaviors/BinarySensor.js\";\nimport { BinarySwitchCCBehaviors } from \"./mockCCBehaviors/BinarySwitch.js\";\nimport { ColorSwitchCCBehaviors } from \"./mockCCBehaviors/ColorSwitch.js\";\nimport { ConfigurationCCBehaviors } from \"./mockCCBehaviors/Configuration.js\";\nimport { EnergyProductionCCBehaviors } from \"./mockCCBehaviors/EnergyProduction.js\";\nimport { IndicatorCCBehaviors } from \"./mockCCBehaviors/Indicator.js\";\nimport { ManufacturerSpecificCCBehaviors } from \"./mockCCBehaviors/ManufacturerSpecific.js\";\nimport { MeterCCBehaviors } from \"./mockCCBehaviors/Meter.js\";\nimport {\n\tMultiChannelCCBehaviors,\n\tMultiChannelCCHooks,\n} from \"./mockCCBehaviors/MultiChannel.js\";\nimport { MultilevelSensorCCBehaviors } from \"./mockCCBehaviors/MultilevelSensor.js\";\nimport { MultilevelSwitchCCBehaviors } from \"./mockCCBehaviors/MultilevelSwitch.js\";\nimport { NodeNamingAndLocationCCBehaviors } from \"./mockCCBehaviors/NodeNamingAndLocation.js\";\nimport { NotificationCCBehaviors } from \"./mockCCBehaviors/Notification.js\";\nimport { ScheduleEntryLockCCBehaviors } from \"./mockCCBehaviors/ScheduleEntryLock.js\";\nimport {\n\tSecurityCCBehaviors,\n\tSecurityCCHooks,\n} from \"./mockCCBehaviors/Security.js\";\nimport {\n\tSecurity2CCBehaviors,\n\tSecurity2CCHooks,\n} from \"./mockCCBehaviors/Security2.js\";\nimport { SoundSwitchCCBehaviors } from \"./mockCCBehaviors/SoundSwitch.js\";\nimport { SupervisionCCHooks } from \"./mockCCBehaviors/Supervision.js\";\nimport { ThermostatModeCCBehaviors } from \"./mockCCBehaviors/ThermostatMode.js\";\nimport { ThermostatSetbackCCBehaviors } from \"./mockCCBehaviors/ThermostatSetback.js\";\nimport { ThermostatSetpointCCBehaviors } from \"./mockCCBehaviors/ThermostatSetpoint.js\";\nimport { UserCodeCCBehaviors } from \"./mockCCBehaviors/UserCode.js\";\nimport { UserCredentialCCBehaviors } from \"./mockCCBehaviors/UserCredential.js\";\nimport { WindowCoveringCCBehaviors } from \"./mockCCBehaviors/WindowCovering.js\";\n\nconst respondToRequestNodeInfo: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (\n\t\t\treceivedCC\n\t\t\t\tinstanceof ZWaveProtocolCCRequestNodeInformationFrame\n\t\t) {\n\t\t\tconst cc = new ZWaveProtocolCCNodeInformationFrame({\n\t\t\t\tnodeId: self.id,\n\t\t\t\t...self.capabilities,\n\t\t\t\tsupportedCCs: [...self.implementedCCs]\n\t\t\t\t\t// Basic CC must not be included in the NIF\n\t\t\t\t\t.filter(([ccId]) => ccId !== CommandClasses.Basic)\n\t\t\t\t\t// Only include supported CCs\n\t\t\t\t\t.filter(([, info]) => info.isSupported)\n\t\t\t\t\t// FIXME: Filter out secure CCs if the node isn't secure\n\t\t\t\t\t.map(([ccId]) => ccId),\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\nconst respondToVersionCCGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (receivedCC instanceof VersionCCGet) {\n\t\t\tconst cc = new VersionCCReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tlibraryType: ZWaveLibraryTypes[\"Enhanced Slave\"],\n\t\t\t\tprotocolVersion: \"7.0\",\n\t\t\t\tfirmwareVersions: [self.capabilities.firmwareVersion],\n\t\t\t\thardwareVersion: 1,\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\nconst respondToVersionCCCommandClassGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (receivedCC instanceof VersionCCCommandClassGet) {\n\t\t\tconst endpoint = receivedCC.endpointIndex === 0\n\t\t\t\t? self\n\t\t\t\t: self.endpoints.get(receivedCC.endpointIndex);\n\t\t\tif (!endpoint) return;\n\n\t\t\tlet version = 0;\n\t\t\tfor (const ep of [self, ...self.endpoints.values()]) {\n\t\t\t\tconst info = ep.implementedCCs.get(receivedCC.requestedCC);\n\t\t\t\tif (info?.version) {\n\t\t\t\t\tversion = info.version;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Basic CC is always supported implicitly\n\t\t\tif (\n\t\t\t\tversion === 0 && receivedCC.requestedCC === CommandClasses.Basic\n\t\t\t) {\n\t\t\t\tversion = 1;\n\t\t\t}\n\n\t\t\tconst cc = new VersionCCCommandClassReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tendpointIndex: \"index\" in endpoint ? endpoint.index : undefined,\n\t\t\t\trequestedCC: receivedCC.requestedCC,\n\t\t\t\tccVersion: version,\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\nconst respondToVersionCCCapabilitiesGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (receivedCC instanceof VersionCCCapabilitiesGet) {\n\t\t\tconst cc = new VersionCCCapabilitiesReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tendpointIndex: receivedCC.endpointIndex,\n\t\t\t\tsupportsZWaveSoftwareGet: false,\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\nconst respondToZWavePlusCCGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (receivedCC instanceof ZWavePlusCCGet) {\n\t\t\tconst cc = new ZWavePlusCCReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tzwavePlusVersion: 2,\n\t\t\t\tnodeType: ZWavePlusNodeType.Node,\n\t\t\t\troleType: self.capabilities.isListening\n\t\t\t\t\t? ZWavePlusRoleType.AlwaysOnSlave\n\t\t\t\t\t: self.capabilities.isFrequentListening\n\t\t\t\t\t? ZWavePlusRoleType.SleepingListeningSlave\n\t\t\t\t\t: ZWavePlusRoleType.SleepingReportingSlave,\n\t\t\t\tinstallerIcon: 0x0000,\n\t\t\t\tuserIcon: 0x0000,\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc, ackRequested: true };\n\t\t}\n\t},\n};\n\nconst respondToS2ZWavePlusCCGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (\n\t\t\treceivedCC instanceof Security2CCMessageEncapsulation\n\t\t\t&& receivedCC.encapsulated instanceof ZWavePlusCCGet\n\t\t) {\n\t\t\tlet cc: CommandClass = new ZWavePlusCCReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tzwavePlusVersion: 2,\n\t\t\t\tnodeType: ZWavePlusNodeType.Node,\n\t\t\t\troleType: self.capabilities.isListening\n\t\t\t\t\t? ZWavePlusRoleType.AlwaysOnSlave\n\t\t\t\t\t: self.capabilities.isFrequentListening\n\t\t\t\t\t? ZWavePlusRoleType.SleepingListeningSlave\n\t\t\t\t\t: ZWavePlusRoleType.SleepingReportingSlave,\n\t\t\t\tinstallerIcon: 0x0000,\n\t\t\t\tuserIcon: 0x0000,\n\t\t\t});\n\t\t\tcc = Security2CC.encapsulate(\n\t\t\t\tcc,\n\t\t\t\tself.id,\n\t\t\t\tself.securityManagers,\n\t\t\t);\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\n/** Predefined default behaviors that are required for interacting with the Mock Controller correctly */\nexport function createDefaultBehaviors(): MockNodeBehavior[] {\n\treturn [\n\t\trespondToRequestNodeInfo,\n\n\t\t...SecurityCCHooks,\n\t\t...SecurityCCBehaviors,\n\t\t...Security2CCHooks,\n\t\t...Security2CCBehaviors,\n\n\t\t...MultiChannelCCHooks,\n\t\t...MultiChannelCCBehaviors,\n\n\t\t...SupervisionCCHooks,\n\n\t\trespondToVersionCCGet,\n\t\trespondToVersionCCCommandClassGet,\n\t\trespondToVersionCCCapabilitiesGet,\n\n\t\trespondToZWavePlusCCGet,\n\t\trespondToS2ZWavePlusCCGet,\n\n\t\t...BasicCCBehaviors,\n\t\t...BinarySensorCCBehaviors,\n\t\t...BinarySwitchCCBehaviors,\n\t\t...ColorSwitchCCBehaviors,\n\t\t...ConfigurationCCBehaviors,\n\t\t...EnergyProductionCCBehaviors,\n\t\t...IndicatorCCBehaviors,\n\t\t...ManufacturerSpecificCCBehaviors,\n\t\t...MeterCCBehaviors,\n\t\t...MultilevelSensorCCBehaviors,\n\t\t...MultilevelSwitchCCBehaviors,\n\t\t...NodeNamingAndLocationCCBehaviors,\n\t\t...NotificationCCBehaviors,\n\t\t...ScheduleEntryLockCCBehaviors,\n\t\t...SoundSwitchCCBehaviors,\n\t\t...ThermostatModeCCBehaviors,\n\t\t...ThermostatSetpointCCBehaviors,\n\t\t...ThermostatSetbackCCBehaviors,\n\t\t...UserCodeCCBehaviors,\n\t\t...UserCredentialCCBehaviors,\n\t\t...WindowCoveringCCBehaviors,\n\t];\n}\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["import {\n\ttype CommandClass,\n\tSecurity2CC,\n\tSecurity2CCMessageEncapsulation,\n\tVersionCCCapabilitiesGet,\n\tVersionCCCapabilitiesReport,\n\tVersionCCCommandClassGet,\n\tVersionCCCommandClassReport,\n\tVersionCCGet,\n\tVersionCCReport,\n\tZWavePlusNodeType,\n\tZWavePlusRoleType,\n} from \"@zwave-js/cc\";\nimport { ZWavePlusCCGet, ZWavePlusCCReport } from \"@zwave-js/cc/ZWavePlusCC\";\nimport {\n\tZWaveProtocolCCNodeInformationFrame,\n\tZWaveProtocolCCRequestNodeInformationFrame,\n} from \"@zwave-js/cc/ZWaveProtocolCC\";\nimport { CommandClasses, ZWaveLibraryTypes } from \"@zwave-js/core\";\nimport type { MockNodeBehavior } from \"@zwave-js/testing\";\n\nimport { BasicCCBehaviors } from \"./mockCCBehaviors/Basic.js\";\nimport { BinarySensorCCBehaviors } from \"./mockCCBehaviors/BinarySensor.js\";\nimport { BinarySwitchCCBehaviors } from \"./mockCCBehaviors/BinarySwitch.js\";\nimport { ColorSwitchCCBehaviors } from \"./mockCCBehaviors/ColorSwitch.js\";\nimport { ConfigurationCCBehaviors } from \"./mockCCBehaviors/Configuration.js\";\nimport { DoorLockCCBehaviors } from \"./mockCCBehaviors/DoorLock.js\";\nimport { EnergyProductionCCBehaviors } from \"./mockCCBehaviors/EnergyProduction.js\";\nimport { IndicatorCCBehaviors } from \"./mockCCBehaviors/Indicator.js\";\nimport { LockCCBehaviors } from \"./mockCCBehaviors/Lock.js\";\nimport { ManufacturerSpecificCCBehaviors } from \"./mockCCBehaviors/ManufacturerSpecific.js\";\nimport { MeterCCBehaviors } from \"./mockCCBehaviors/Meter.js\";\nimport {\n\tMultiChannelCCBehaviors,\n\tMultiChannelCCHooks,\n} from \"./mockCCBehaviors/MultiChannel.js\";\nimport { MultilevelSensorCCBehaviors } from \"./mockCCBehaviors/MultilevelSensor.js\";\nimport { MultilevelSwitchCCBehaviors } from \"./mockCCBehaviors/MultilevelSwitch.js\";\nimport { NodeNamingAndLocationCCBehaviors } from \"./mockCCBehaviors/NodeNamingAndLocation.js\";\nimport { NotificationCCBehaviors } from \"./mockCCBehaviors/Notification.js\";\nimport { ScheduleEntryLockCCBehaviors } from \"./mockCCBehaviors/ScheduleEntryLock.js\";\nimport {\n\tSecurityCCBehaviors,\n\tSecurityCCHooks,\n} from \"./mockCCBehaviors/Security.js\";\nimport {\n\tSecurity2CCBehaviors,\n\tSecurity2CCHooks,\n} from \"./mockCCBehaviors/Security2.js\";\nimport { SoundSwitchCCBehaviors } from \"./mockCCBehaviors/SoundSwitch.js\";\nimport { SupervisionCCHooks } from \"./mockCCBehaviors/Supervision.js\";\nimport { ThermostatModeCCBehaviors } from \"./mockCCBehaviors/ThermostatMode.js\";\nimport { ThermostatSetbackCCBehaviors } from \"./mockCCBehaviors/ThermostatSetback.js\";\nimport { ThermostatSetpointCCBehaviors } from \"./mockCCBehaviors/ThermostatSetpoint.js\";\nimport { UserCodeCCBehaviors } from \"./mockCCBehaviors/UserCode.js\";\nimport { UserCredentialCCBehaviors } from \"./mockCCBehaviors/UserCredential.js\";\nimport { WindowCoveringCCBehaviors } from \"./mockCCBehaviors/WindowCovering.js\";\n\nconst respondToRequestNodeInfo: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (\n\t\t\treceivedCC\n\t\t\t\tinstanceof ZWaveProtocolCCRequestNodeInformationFrame\n\t\t) {\n\t\t\tconst cc = new ZWaveProtocolCCNodeInformationFrame({\n\t\t\t\tnodeId: self.id,\n\t\t\t\t...self.capabilities,\n\t\t\t\tsupportedCCs: [...self.implementedCCs]\n\t\t\t\t\t// Basic CC must not be included in the NIF\n\t\t\t\t\t.filter(([ccId]) => ccId !== CommandClasses.Basic)\n\t\t\t\t\t// Only include supported CCs\n\t\t\t\t\t.filter(([, info]) => info.isSupported)\n\t\t\t\t\t// FIXME: Filter out secure CCs if the node isn't secure\n\t\t\t\t\t.map(([ccId]) => ccId),\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\nconst respondToVersionCCGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (receivedCC instanceof VersionCCGet) {\n\t\t\tconst cc = new VersionCCReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tlibraryType: ZWaveLibraryTypes[\"Enhanced Slave\"],\n\t\t\t\tprotocolVersion: \"7.0\",\n\t\t\t\tfirmwareVersions: [self.capabilities.firmwareVersion],\n\t\t\t\thardwareVersion: 1,\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\nconst respondToVersionCCCommandClassGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (receivedCC instanceof VersionCCCommandClassGet) {\n\t\t\tconst endpoint = receivedCC.endpointIndex === 0\n\t\t\t\t? self\n\t\t\t\t: self.endpoints.get(receivedCC.endpointIndex);\n\t\t\tif (!endpoint) return;\n\n\t\t\tlet version = 0;\n\t\t\tfor (const ep of [self, ...self.endpoints.values()]) {\n\t\t\t\tconst info = ep.implementedCCs.get(receivedCC.requestedCC);\n\t\t\t\tif (info?.version) {\n\t\t\t\t\tversion = info.version;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Basic CC is always supported implicitly\n\t\t\tif (\n\t\t\t\tversion === 0 && receivedCC.requestedCC === CommandClasses.Basic\n\t\t\t) {\n\t\t\t\tversion = 1;\n\t\t\t}\n\n\t\t\tconst cc = new VersionCCCommandClassReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tendpointIndex: \"index\" in endpoint ? endpoint.index : undefined,\n\t\t\t\trequestedCC: receivedCC.requestedCC,\n\t\t\t\tccVersion: version,\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\nconst respondToVersionCCCapabilitiesGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (receivedCC instanceof VersionCCCapabilitiesGet) {\n\t\t\tconst cc = new VersionCCCapabilitiesReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tendpointIndex: receivedCC.endpointIndex,\n\t\t\t\tsupportsZWaveSoftwareGet: false,\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\nconst respondToZWavePlusCCGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (receivedCC instanceof ZWavePlusCCGet) {\n\t\t\tconst cc = new ZWavePlusCCReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tzwavePlusVersion: 2,\n\t\t\t\tnodeType: ZWavePlusNodeType.Node,\n\t\t\t\troleType: self.capabilities.isListening\n\t\t\t\t\t? ZWavePlusRoleType.AlwaysOnSlave\n\t\t\t\t\t: self.capabilities.isFrequentListening\n\t\t\t\t\t? ZWavePlusRoleType.SleepingListeningSlave\n\t\t\t\t\t: ZWavePlusRoleType.SleepingReportingSlave,\n\t\t\t\tinstallerIcon: 0x0000,\n\t\t\t\tuserIcon: 0x0000,\n\t\t\t});\n\t\t\treturn { action: \"sendCC\", cc, ackRequested: true };\n\t\t}\n\t},\n};\n\nconst respondToS2ZWavePlusCCGet: MockNodeBehavior = {\n\thandleCC(controller, self, receivedCC) {\n\t\tif (\n\t\t\treceivedCC instanceof Security2CCMessageEncapsulation\n\t\t\t&& receivedCC.encapsulated instanceof ZWavePlusCCGet\n\t\t) {\n\t\t\tlet cc: CommandClass = new ZWavePlusCCReport({\n\t\t\t\tnodeId: controller.ownNodeId,\n\t\t\t\tzwavePlusVersion: 2,\n\t\t\t\tnodeType: ZWavePlusNodeType.Node,\n\t\t\t\troleType: self.capabilities.isListening\n\t\t\t\t\t? ZWavePlusRoleType.AlwaysOnSlave\n\t\t\t\t\t: self.capabilities.isFrequentListening\n\t\t\t\t\t? ZWavePlusRoleType.SleepingListeningSlave\n\t\t\t\t\t: ZWavePlusRoleType.SleepingReportingSlave,\n\t\t\t\tinstallerIcon: 0x0000,\n\t\t\t\tuserIcon: 0x0000,\n\t\t\t});\n\t\t\tcc = Security2CC.encapsulate(\n\t\t\t\tcc,\n\t\t\t\tself.id,\n\t\t\t\tself.securityManagers,\n\t\t\t);\n\t\t\treturn { action: \"sendCC\", cc };\n\t\t}\n\t},\n};\n\n/** Predefined default behaviors that are required for interacting with the Mock Controller correctly */\nexport function createDefaultBehaviors(): MockNodeBehavior[] {\n\treturn [\n\t\trespondToRequestNodeInfo,\n\n\t\t...SecurityCCHooks,\n\t\t...SecurityCCBehaviors,\n\t\t...Security2CCHooks,\n\t\t...Security2CCBehaviors,\n\n\t\t...MultiChannelCCHooks,\n\t\t...MultiChannelCCBehaviors,\n\n\t\t...SupervisionCCHooks,\n\n\t\trespondToVersionCCGet,\n\t\trespondToVersionCCCommandClassGet,\n\t\trespondToVersionCCCapabilitiesGet,\n\n\t\trespondToZWavePlusCCGet,\n\t\trespondToS2ZWavePlusCCGet,\n\n\t\t...BasicCCBehaviors,\n\t\t...BinarySensorCCBehaviors,\n\t\t...BinarySwitchCCBehaviors,\n\t\t...ColorSwitchCCBehaviors,\n\t\t...ConfigurationCCBehaviors,\n\t\t...DoorLockCCBehaviors,\n\t\t...EnergyProductionCCBehaviors,\n\t\t...LockCCBehaviors,\n\t\t...IndicatorCCBehaviors,\n\t\t...ManufacturerSpecificCCBehaviors,\n\t\t...MeterCCBehaviors,\n\t\t...MultilevelSensorCCBehaviors,\n\t\t...MultilevelSwitchCCBehaviors,\n\t\t...NodeNamingAndLocationCCBehaviors,\n\t\t...NotificationCCBehaviors,\n\t\t...ScheduleEntryLockCCBehaviors,\n\t\t...SoundSwitchCCBehaviors,\n\t\t...ThermostatModeCCBehaviors,\n\t\t...ThermostatSetpointCCBehaviors,\n\t\t...ThermostatSetbackCCBehaviors,\n\t\t...UserCodeCCBehaviors,\n\t\t...UserCredentialCCBehaviors,\n\t\t...WindowCoveringCCBehaviors,\n\t];\n}\n"],
5
+ "mappings": "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",
6
6
  "names": []
7
7
  }
@@ -5,7 +5,7 @@ import type { AllOrNone, BytesView } from "@zwave-js/shared";
5
5
  import type { Endpoint } from "./Endpoint.js";
6
6
  import type { ZWaveNode } from "./Node.js";
7
7
  import type { RouteStatistics } from "./NodeStatistics.js";
8
- import type { UserData } from "./endpoint-mixins/05_AccessControl.js";
8
+ import type { UserData } from "./feature-apis/AccessControl.js";
9
9
  export { EntryControlDataTypes, EntryControlEventTypes, FirmwareUpdateStatus, MultilevelSwitchCommand, Powerlevel, PowerlevelTestStatus, } from "@zwave-js/cc";
10
10
  export { ControllerStatus, InterviewStage, NodeStatus } from "@zwave-js/core";
11
11
  export type NodeInterviewFailedEventArgs = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/lib/node/_Types.ts"],
4
- "sourcesContent": ["import type {\n\tBatteryReplacementStatus,\n\tEntryControlDataTypes,\n\tEntryControlEventTypes,\n\tFirmwareUpdateProgress,\n\tFirmwareUpdateResult,\n\tMultilevelSwitchCommand,\n\tPowerlevel,\n\tPowerlevelTestStatus,\n\tUserCredentialLearnStatus,\n\tUserCredentialType,\n\tWeekday,\n} from \"@zwave-js/cc\";\nimport type { NotificationCCReport } from \"@zwave-js/cc/NotificationCC\";\nimport type {\n\tCommandClasses,\n\tMetadataUpdatedArgs,\n\tNodeStatus,\n\tTranslatedValueID,\n\tValueAddedArgs,\n\tValueNotificationArgs,\n\tValueRemovedArgs,\n\tValueUpdatedArgs,\n} from \"@zwave-js/core\";\nimport type { AllOrNone, BytesView } from \"@zwave-js/shared\";\nimport type { Endpoint } from \"./Endpoint.js\";\nimport type { ZWaveNode } from \"./Node.js\";\nimport type { RouteStatistics } from \"./NodeStatistics.js\";\nimport type { UserData } from \"./endpoint-mixins/05_AccessControl.js\";\n\nexport {\n\tEntryControlDataTypes,\n\tEntryControlEventTypes,\n\tFirmwareUpdateStatus,\n\tMultilevelSwitchCommand,\n\tPowerlevel,\n\tPowerlevelTestStatus,\n} from \"@zwave-js/cc\";\nexport { ControllerStatus, InterviewStage, NodeStatus } from \"@zwave-js/core\";\n\nexport type NodeInterviewFailedEventArgs =\n\t& {\n\t\terrorMessage: string;\n\t\tisFinal: boolean;\n\t}\n\t& AllOrNone<{\n\t\tattempt: number;\n\t\tmaxAttempts: number;\n\t}>;\n\nexport type ZWaveNodeValueAddedArgs = ValueAddedArgs & TranslatedValueID;\nexport type ZWaveNodeValueUpdatedArgs =\n\t& Omit<ValueUpdatedArgs, \"source\">\n\t& TranslatedValueID;\nexport type ZWaveNodeValueRemovedArgs = ValueRemovedArgs & TranslatedValueID;\nexport type ZWaveNodeValueNotificationArgs =\n\t& ValueNotificationArgs\n\t& TranslatedValueID;\n\nexport type ZWaveNodeMetadataUpdatedArgs =\n\t& MetadataUpdatedArgs\n\t& TranslatedValueID;\n\nexport type ZWaveNodeValueAddedCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeValueAddedArgs,\n) => void;\nexport type ZWaveNodeValueUpdatedCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeValueUpdatedArgs,\n) => void;\nexport type ZWaveNodeValueRemovedCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeValueRemovedArgs,\n) => void;\nexport type ZWaveNodeValueNotificationCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeValueNotificationArgs,\n) => void;\nexport type ZWaveNodeMetadataUpdatedCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeMetadataUpdatedArgs,\n) => void;\nexport type ZWaveInterviewFailedCallback = (\n\tnode: ZWaveNode,\n\targs: NodeInterviewFailedEventArgs,\n) => void;\nexport type ZWaveNodeFirmwareUpdateProgressCallback = (\n\tnode: ZWaveNode,\n\tprogress: FirmwareUpdateProgress,\n) => void;\nexport type ZWaveNodeFirmwareUpdateFinishedCallback = (\n\tnode: ZWaveNode,\n\tresult: FirmwareUpdateResult,\n) => void;\nexport type ZWaveNodeStatusChangeCallback = (\n\tnode: ZWaveNode,\n\toldStatus: NodeStatus,\n) => void;\n\n/**\n * This is emitted when a start or stop event is received\n */\nexport interface ZWaveNotificationCallbackArgs_MultilevelSwitchCC {\n\t/** The numeric identifier for the event type */\n\teventType:\n\t\t| MultilevelSwitchCommand.StartLevelChange\n\t\t| MultilevelSwitchCommand.StopLevelChange;\n\t/** A human-readable label for the event type */\n\teventTypeLabel: string;\n\t/** The direction of the level change */\n\tdirection?: string;\n}\n\n/**\n * Parameter types for the MultilevelSwitch CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_MultilevelSwitchCC = [\n\tendpoint: Endpoint,\n\tccId: (typeof CommandClasses)[\"Multilevel Switch\"],\n\targs: ZWaveNotificationCallbackArgs_MultilevelSwitchCC,\n];\n\nexport interface ZWaveNotificationCallbackArgs_NotificationCC {\n\t/** The numeric identifier for the notification type */\n\ttype: number;\n\t/** The human-readable label for the notification type */\n\tlabel: string;\n\t/** The numeric identifier for the notification event */\n\tevent: number;\n\t/** The human-readable label for the notification event */\n\teventLabel: string;\n\t/** Additional information related to the event */\n\tparameters?:\n\t\t| NotificationCCReport[\"eventParameters\"]\n\t\t| Record<string, number | string | BytesView>;\n}\n\n/**\n * Parameter types for the Notification CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_NotificationCC = [\n\tendpoint: Endpoint,\n\tccId: CommandClasses.Notification,\n\targs: ZWaveNotificationCallbackArgs_NotificationCC,\n];\n\nexport interface ZWaveNotificationCapability_NotificationCC {\n\tcommandClass: CommandClasses.Notification;\n\tendpoint: number;\n\t/** A dictionary of supported event types and information */\n\tsupportedNotificationTypes: Record<number, {\n\t\t/** The human-readable label for the notification type */\n\t\tlabel: string;\n\t\t/** A dictionary of supported events for this notification type and their human-readable labels */\n\t\tsupportedEvents: Record<number, string>;\n\t}>;\n}\n\n/**\n * This is emitted when an unsolicited powerlevel test report is received\n */\nexport interface ZWaveNotificationCallbackArgs_PowerlevelCC {\n\ttestNodeId: number;\n\tstatus: PowerlevelTestStatus;\n\tacknowledgedFrames: number;\n}\n\n/**\n * Parameter types for the Powerlevel CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_PowerlevelCC = [\n\tendpoint: Endpoint,\n\tccId: CommandClasses.Powerlevel,\n\targs: ZWaveNotificationCallbackArgs_PowerlevelCC,\n];\n\nexport interface ZWaveNotificationCallbackArgs_EntryControlCC {\n\teventType: EntryControlEventTypes;\n\t/** A human-readable label for the event type */\n\teventTypeLabel: string;\n\tdataType: EntryControlDataTypes;\n\t/** A human-readable label for the data type */\n\tdataTypeLabel: string;\n\teventData?: BytesView | string;\n}\n\n/**\n * Parameter types for the Entry Control CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_EntryControlCC = [\n\tendpoint: Endpoint,\n\tccId: (typeof CommandClasses)[\"Entry Control\"],\n\targs: ZWaveNotificationCallbackArgs_EntryControlCC,\n];\n\nexport interface ZWaveNotificationCapability_EntryControlCC {\n\tcommandClass: (typeof CommandClasses)[\"Entry Control\"];\n\tendpoint: number;\n\t/** A dictionary of supported event types and their human-readable labels */\n\tsupportedEventTypes: Record<EntryControlEventTypes, string>;\n}\n\nexport type ZWaveNotificationCallbackArgs_BatteryCC = {\n\teventType: \"battery low\";\n\turgency: BatteryReplacementStatus.Soon | BatteryReplacementStatus.Now;\n};\n\n/**\n * Parameter types for the Battery CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_BatteryCC = [\n\tendpoint: Endpoint,\n\tccId: (typeof CommandClasses.Battery),\n\targs: ZWaveNotificationCallbackArgs_BatteryCC,\n];\n\nexport type ZWaveNotificationCallback = (\n\t...args:\n\t\t| ZWaveNotificationCallbackParams_NotificationCC\n\t\t| ZWaveNotificationCallbackParams_EntryControlCC\n\t\t| ZWaveNotificationCallbackParams_PowerlevelCC\n\t\t| ZWaveNotificationCallbackParams_MultilevelSwitchCC\n\t\t| ZWaveNotificationCallbackParams_BatteryCC\n) => void;\n\nexport type ZWaveNotificationCapability =\n\t| ZWaveNotificationCapability_NotificationCC\n\t| ZWaveNotificationCapability_EntryControlCC;\n\nexport interface ZWaveNodeValueEventCallbacks {\n\t\"value added\": ZWaveNodeValueAddedCallback;\n\t\"value updated\": ZWaveNodeValueUpdatedCallback;\n\t\"value removed\": ZWaveNodeValueRemovedCallback;\n\t\"metadata updated\": ZWaveNodeMetadataUpdatedCallback;\n\t\"value notification\": ZWaveNodeValueNotificationCallback;\n}\n\nexport interface UserDeletedArgs {\n\tuserId: number;\n}\n\nexport interface CredentialChangedArgs {\n\tuserId: number;\n\tcredentialType: UserCredentialType;\n\tcredentialSlot: number;\n\tdata?: string | Uint8Array;\n}\n\nexport interface CredentialDeletedArgs {\n\tuserId: number;\n\tcredentialType: UserCredentialType;\n\tcredentialSlot: number;\n}\n\nexport interface CredentialLearnProgressArgs {\n\tuserId: number;\n\tcredentialType: UserCredentialType;\n\tcredentialSlot: number;\n\tstepsRemaining: number;\n\tstatus: UserCredentialLearnStatus;\n}\n\nexport interface CredentialLearnCompletedArgs {\n\tuserId: number;\n\tcredentialType: UserCredentialType;\n\tcredentialSlot: number;\n\tstatus: UserCredentialLearnStatus;\n\tsuccess: boolean;\n}\n\nexport interface ZWaveNodeEventCallbacks extends ZWaveNodeValueEventCallbacks {\n\tnotification: ZWaveNotificationCallback;\n\t\"interview failed\": ZWaveInterviewFailedCallback;\n\t\"firmware update progress\": ZWaveNodeFirmwareUpdateProgressCallback;\n\t\"firmware update finished\": ZWaveNodeFirmwareUpdateFinishedCallback;\n\t\"wake up\": ZWaveNodeStatusChangeCallback;\n\tsleep: ZWaveNodeStatusChangeCallback;\n\tdead: ZWaveNodeStatusChangeCallback;\n\talive: ZWaveNodeStatusChangeCallback;\n\t\"interview completed\": (node: ZWaveNode) => void;\n\tready: (node: ZWaveNode) => void;\n\t\"interview stage completed\": (node: ZWaveNode, stageName: string) => void;\n\t\"interview started\": (node: ZWaveNode) => void;\n\t\"node info received\": (node: ZWaveNode) => void;\n\t\"user added\": (endpoint: Endpoint, args: UserData) => void;\n\t\"user modified\": (endpoint: Endpoint, args: UserData) => void;\n\t\"user deleted\": (endpoint: Endpoint, args: UserDeletedArgs) => void;\n\t\"credential added\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialChangedArgs,\n\t) => void;\n\t\"credential modified\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialChangedArgs,\n\t) => void;\n\t\"credential deleted\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialDeletedArgs,\n\t) => void;\n\t\"credential learn progress\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialLearnProgressArgs,\n\t) => void;\n\t\"credential learn completed\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialLearnCompletedArgs,\n\t) => void;\n}\n\nexport type ZWaveNodeEvents = Extract<keyof ZWaveNodeEventCallbacks, string>;\n\nexport const zWaveNodeEvents = [\n\t\"notification\",\n\t\"interview failed\",\n\t\"firmware update progress\",\n\t\"firmware update finished\",\n\t\"wake up\",\n\t\"sleep\",\n\t\"dead\",\n\t\"alive\",\n\t\"interview completed\",\n\t\"ready\",\n\t\"interview stage completed\",\n\t\"interview started\",\n\t\"value added\",\n\t\"value updated\",\n\t\"value removed\",\n\t\"metadata updated\",\n\t\"value notification\",\n\t\"user added\",\n\t\"user modified\",\n\t\"user deleted\",\n\t\"credential added\",\n\t\"credential modified\",\n\t\"credential deleted\",\n\t\"credential learn progress\",\n\t\"credential learn completed\",\n] as const satisfies readonly ZWaveNodeEvents[];\n\n/** Represents the result of one health check round of a node's lifeline */\nexport interface LifelineHealthCheckResult {\n\t/**\n\t * How many times at least one new route was needed. Lower = better, ideally 0.\n\t *\n\t * Only available if the controller supports TX reports.\n\t */\n\trouteChanges?: number;\n\t/**\n\t * The maximum time it took to send a ping to the node. Lower = better, ideally 10 ms.\n\t *\n\t * Will use the time in TX reports if available, otherwise fall back to measuring the round trip time.\n\t */\n\tlatency: number;\n\n\t/**\n\t * How many routing neighbors this node has (Z-Wave Classic only). Higher = better, ideally > 2.\n\t * For Z-Wave LR, this is undefined.\n\t */\n\tnumNeighbors?: number;\n\n\t/**\n\t * How many pings were not ACKed by the node. Lower = better, ideally 0.\n\t */\n\tfailedPingsNode: number;\n\n\t/**\n\t * The minimum powerlevel where all pings from the node were ACKed by the controller. Higher = better, ideally 6dBm or more.\n\t *\n\t * Only available if the node supports Powerlevel CC\n\t */\n\tminPowerlevel?: Powerlevel;\n\t/**\n\t * If no powerlevel was found where the controller ACKed all pings from the node, this contains the number of pings that weren't ACKed. Lower = better, ideally 0.\n\t *\n\t * Only available if the node supports Powerlevel CC\n\t */\n\tfailedPingsController?: number;\n\n\t/**\n\t * An estimation of the Signal-to-Noise Ratio Margin in dBm.\n\t *\n\t * Only available if the controller supports TX reports.\n\t */\n\tsnrMargin?: number;\n\n\t/** See {@link LifelineHealthCheckSummary.rating} */\n\trating: number;\n}\n\nexport interface LifelineHealthCheckSummary {\n\t/** The check results of each round */\n\tresults: LifelineHealthCheckResult[];\n\t/**\n\t * The health rating expressed as a number from 0 (not working at all) to 10 (perfect connectivity).\n\t * The rating is calculated evaluating the test results of the worst round similar to Silabs' PC controller.\n\t * Each rating is only achieved if all the requirements are fulfilled.\n\t *\n\t * | Rating | Failed pings | Latency | No. of neighbors | min. powerlevel | SNR margin |\n\t * | -----: | -----------: | ------------: | ---------------: | --------------: | ---------: |\n\t * | \u2705 10 | 0 | \u2264 50 ms | > 2 | \u2264 \u22126 dBm | \u2265 17 dBm |\n\t * | \uD83D\uDFE2 9 | 0 | \u2264 100 ms | > 2 | \u2264 \u22126 dBm | \u2265 17 dBm |\n\t * | \uD83D\uDFE2 8 | 0 | \u2264 100 ms | \u2264 2 | \u2264 \u22126 dBm | \u2265 17 dBm |\n\t * | \uD83D\uDFE2 7 | 0 | \u2264 100 ms | > 2 | - | - |\n\t * | \uD83D\uDFE2 6 | 0 | \u2264 100 ms | \u2264 2 | - | - |\n\t * | | | | | | |\n\t * | \uD83D\uDFE1 5 | 0 | \u2264 250 ms | - | - | - |\n\t * | \uD83D\uDFE1 4 | 0 | \u2264 500 ms | - | - | - |\n\t * | | | | | | |\n\t * | \uD83D\uDD34 3 | 1 | \u2264 1000 ms | - | - | - |\n\t * | \uD83D\uDD34 2 | \u2264 2 | > 1000 ms | - | - | - |\n\t * | \uD83D\uDD34 1 | \u2264 9 | - | - | - | - |\n\t * | | | | | | |\n\t * | \u274C 0 | 10 | - | - | - | - |\n\t *\n\t * If the min. powerlevel or SNR margin can not be measured, the condition is assumed to be fulfilled.\n\t * The no. of neighbors is only relevant for Z-Wave Classic. The condition is assumed to be fulfilled for Z-Wave LR.\n\t */\n\trating: number;\n}\n\n/** Represents the result of one health check round of a route between two nodes */\nexport interface RouteHealthCheckResult {\n\t/** How many routing neighbors this node has. Higher = better, ideally > 2. */\n\tnumNeighbors: number;\n\t/**\n\t * How many pings were not ACKed by the target node. Lower = better, ideally 0.\n\t *\n\t * Only available if the source node supports Powerlevel CC\n\t */\n\tfailedPingsToTarget?: number;\n\t/**\n\t * How many pings were not ACKed by the source node. Lower = better, ideally 0.\n\t *\n\t * Only available if the target node supports Powerlevel CC\n\t */\n\tfailedPingsToSource?: number;\n\t/**\n\t * The minimum powerlevel where all pings from the source node were ACKed by the target node. Higher = better, ideally 6dBm or more.\n\t *\n\t * Only available if the source node supports Powerlevel CC\n\t */\n\tminPowerlevelSource?: Powerlevel;\n\t/**\n\t * The minimum powerlevel where all pings from the target node were ACKed by the source node. Higher = better, ideally 6dBm or more.\n\t *\n\t * Only available if the source node supports Powerlevel CC\n\t */\n\tminPowerlevelTarget?: Powerlevel;\n\n\t/** See {@link RouteHealthCheckSummary.rating} */\n\trating: number;\n}\n\nexport interface RouteHealthCheckSummary {\n\t/** The check results of each round */\n\tresults: RouteHealthCheckResult[];\n\t/**\n\t * The health rating expressed as a number from 0 (not working at all) to 10 (perfect connectivity).\n\t * See {@link LifelineHealthCheckSummary.rating} for a detailed description.\n\t *\n\t * Because the connection between two nodes can only be evaluated with successful pings, the ratings 4, 5 and 9\n\t * cannot be achieved in this test:\n\t *\n\t * | Rating | Failed pings | No. of neighbors | min. powerlevel |\n\t * | -----: | -----------: | ---------------: | --------------: |\n\t * | \u2705 10 | 0 | > 2 | \u2264 \u22126 dBm |\n\t * | \uD83D\uDFE2 8 | 0 | \u2264 2 | \u2264 \u22126 dBm |\n\t * | \uD83D\uDFE2 7 | 0 | > 2 | - |\n\t * | \uD83D\uDFE2 6 | 0 | \u2264 2 | - |\n\t * | | | | |\n\t * | \uD83D\uDD34 3 | 1 | - | - |\n\t * | \uD83D\uDD34 2 | 2 | - | - |\n\t * | \uD83D\uDD34 1 | \u2264 9 | - | - |\n\t * | | | | |\n\t * | \u274C 0 | 10 | - | - |\n\t */\n\trating: number;\n}\n\nexport enum LinkReliabilityCheckMode {\n\tBasicSetOnOff,\n}\n\nexport interface LinkReliabilityCheckOptions {\n\tmode: LinkReliabilityCheckMode;\n\tinterval: number;\n\trounds?: number;\n\tonProgress?: (progress: LinkReliabilityCheckResult) => void;\n}\n\nexport interface LinkReliabilityCheckResult {\n\trounds: number;\n\n\tcommandsSent: number;\n\tcommandErrors: number;\n\tmissingResponses?: number;\n\n\tlatency?: {\n\t\tmin: number;\n\t\tmax: number;\n\t\taverage: number;\n\t};\n\n\trtt: {\n\t\tmin: number;\n\t\tmax: number;\n\t\taverage: number;\n\t};\n\n\tackRSSI: {\n\t\tmin: number;\n\t\tmax: number;\n\t\taverage: number;\n\t};\n\n\tresponseRSSI?: {\n\t\tmin: number;\n\t\tmax: number;\n\t\taverage: number;\n\t};\n}\n\nexport interface RefreshInfoOptions {\n\t/**\n\t * Whether a re-interview should also reset the known security classes.\n\t * Default: false\n\t */\n\tresetSecurityClasses?: boolean;\n\n\t/**\n\t * Whether the information about sleeping nodes should only be reset when the node wakes up.\n\t * Default: true\n\t */\n\twaitForWakeup?: boolean;\n}\n\n/** The last known routes between the controller and a node */\nexport interface LifelineRoutes {\n\t/** The last working route from the controller to this node. */\n\tlwr?: RouteStatistics;\n\t/** The next to last working route from the controller to this node. */\n\tnlwr?: RouteStatistics;\n}\n\nexport type DateAndTime =\n\t& AllOrNone<{\n\t\thour: number;\n\t\tminute: number;\n\t}>\n\t& (\n\t\t| { weekday?: Weekday; second?: undefined }\n\t\t| { weekday?: undefined; second?: number }\n\t)\n\t& AllOrNone<{\n\t\tyear: number;\n\t\tmonth: number;\n\t\tday: number;\n\t}>\n\t& AllOrNone<{\n\t\tdstOffset: number;\n\t\tstandardOffset: number;\n\t}>;\n"],
4
+ "sourcesContent": ["import type {\n\tBatteryReplacementStatus,\n\tEntryControlDataTypes,\n\tEntryControlEventTypes,\n\tFirmwareUpdateProgress,\n\tFirmwareUpdateResult,\n\tMultilevelSwitchCommand,\n\tPowerlevel,\n\tPowerlevelTestStatus,\n\tUserCredentialLearnStatus,\n\tUserCredentialType,\n\tWeekday,\n} from \"@zwave-js/cc\";\nimport type { NotificationCCReport } from \"@zwave-js/cc/NotificationCC\";\nimport type {\n\tCommandClasses,\n\tMetadataUpdatedArgs,\n\tNodeStatus,\n\tTranslatedValueID,\n\tValueAddedArgs,\n\tValueNotificationArgs,\n\tValueRemovedArgs,\n\tValueUpdatedArgs,\n} from \"@zwave-js/core\";\nimport type { AllOrNone, BytesView } from \"@zwave-js/shared\";\nimport type { Endpoint } from \"./Endpoint.js\";\nimport type { ZWaveNode } from \"./Node.js\";\nimport type { RouteStatistics } from \"./NodeStatistics.js\";\nimport type { UserData } from \"./feature-apis/AccessControl.js\";\n\nexport {\n\tEntryControlDataTypes,\n\tEntryControlEventTypes,\n\tFirmwareUpdateStatus,\n\tMultilevelSwitchCommand,\n\tPowerlevel,\n\tPowerlevelTestStatus,\n} from \"@zwave-js/cc\";\nexport { ControllerStatus, InterviewStage, NodeStatus } from \"@zwave-js/core\";\n\nexport type NodeInterviewFailedEventArgs =\n\t& {\n\t\terrorMessage: string;\n\t\tisFinal: boolean;\n\t}\n\t& AllOrNone<{\n\t\tattempt: number;\n\t\tmaxAttempts: number;\n\t}>;\n\nexport type ZWaveNodeValueAddedArgs = ValueAddedArgs & TranslatedValueID;\nexport type ZWaveNodeValueUpdatedArgs =\n\t& Omit<ValueUpdatedArgs, \"source\">\n\t& TranslatedValueID;\nexport type ZWaveNodeValueRemovedArgs = ValueRemovedArgs & TranslatedValueID;\nexport type ZWaveNodeValueNotificationArgs =\n\t& ValueNotificationArgs\n\t& TranslatedValueID;\n\nexport type ZWaveNodeMetadataUpdatedArgs =\n\t& MetadataUpdatedArgs\n\t& TranslatedValueID;\n\nexport type ZWaveNodeValueAddedCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeValueAddedArgs,\n) => void;\nexport type ZWaveNodeValueUpdatedCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeValueUpdatedArgs,\n) => void;\nexport type ZWaveNodeValueRemovedCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeValueRemovedArgs,\n) => void;\nexport type ZWaveNodeValueNotificationCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeValueNotificationArgs,\n) => void;\nexport type ZWaveNodeMetadataUpdatedCallback = (\n\tnode: ZWaveNode,\n\targs: ZWaveNodeMetadataUpdatedArgs,\n) => void;\nexport type ZWaveInterviewFailedCallback = (\n\tnode: ZWaveNode,\n\targs: NodeInterviewFailedEventArgs,\n) => void;\nexport type ZWaveNodeFirmwareUpdateProgressCallback = (\n\tnode: ZWaveNode,\n\tprogress: FirmwareUpdateProgress,\n) => void;\nexport type ZWaveNodeFirmwareUpdateFinishedCallback = (\n\tnode: ZWaveNode,\n\tresult: FirmwareUpdateResult,\n) => void;\nexport type ZWaveNodeStatusChangeCallback = (\n\tnode: ZWaveNode,\n\toldStatus: NodeStatus,\n) => void;\n\n/**\n * This is emitted when a start or stop event is received\n */\nexport interface ZWaveNotificationCallbackArgs_MultilevelSwitchCC {\n\t/** The numeric identifier for the event type */\n\teventType:\n\t\t| MultilevelSwitchCommand.StartLevelChange\n\t\t| MultilevelSwitchCommand.StopLevelChange;\n\t/** A human-readable label for the event type */\n\teventTypeLabel: string;\n\t/** The direction of the level change */\n\tdirection?: string;\n}\n\n/**\n * Parameter types for the MultilevelSwitch CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_MultilevelSwitchCC = [\n\tendpoint: Endpoint,\n\tccId: (typeof CommandClasses)[\"Multilevel Switch\"],\n\targs: ZWaveNotificationCallbackArgs_MultilevelSwitchCC,\n];\n\nexport interface ZWaveNotificationCallbackArgs_NotificationCC {\n\t/** The numeric identifier for the notification type */\n\ttype: number;\n\t/** The human-readable label for the notification type */\n\tlabel: string;\n\t/** The numeric identifier for the notification event */\n\tevent: number;\n\t/** The human-readable label for the notification event */\n\teventLabel: string;\n\t/** Additional information related to the event */\n\tparameters?:\n\t\t| NotificationCCReport[\"eventParameters\"]\n\t\t| Record<string, number | string | BytesView>;\n}\n\n/**\n * Parameter types for the Notification CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_NotificationCC = [\n\tendpoint: Endpoint,\n\tccId: CommandClasses.Notification,\n\targs: ZWaveNotificationCallbackArgs_NotificationCC,\n];\n\nexport interface ZWaveNotificationCapability_NotificationCC {\n\tcommandClass: CommandClasses.Notification;\n\tendpoint: number;\n\t/** A dictionary of supported event types and information */\n\tsupportedNotificationTypes: Record<number, {\n\t\t/** The human-readable label for the notification type */\n\t\tlabel: string;\n\t\t/** A dictionary of supported events for this notification type and their human-readable labels */\n\t\tsupportedEvents: Record<number, string>;\n\t}>;\n}\n\n/**\n * This is emitted when an unsolicited powerlevel test report is received\n */\nexport interface ZWaveNotificationCallbackArgs_PowerlevelCC {\n\ttestNodeId: number;\n\tstatus: PowerlevelTestStatus;\n\tacknowledgedFrames: number;\n}\n\n/**\n * Parameter types for the Powerlevel CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_PowerlevelCC = [\n\tendpoint: Endpoint,\n\tccId: CommandClasses.Powerlevel,\n\targs: ZWaveNotificationCallbackArgs_PowerlevelCC,\n];\n\nexport interface ZWaveNotificationCallbackArgs_EntryControlCC {\n\teventType: EntryControlEventTypes;\n\t/** A human-readable label for the event type */\n\teventTypeLabel: string;\n\tdataType: EntryControlDataTypes;\n\t/** A human-readable label for the data type */\n\tdataTypeLabel: string;\n\teventData?: BytesView | string;\n}\n\n/**\n * Parameter types for the Entry Control CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_EntryControlCC = [\n\tendpoint: Endpoint,\n\tccId: (typeof CommandClasses)[\"Entry Control\"],\n\targs: ZWaveNotificationCallbackArgs_EntryControlCC,\n];\n\nexport interface ZWaveNotificationCapability_EntryControlCC {\n\tcommandClass: (typeof CommandClasses)[\"Entry Control\"];\n\tendpoint: number;\n\t/** A dictionary of supported event types and their human-readable labels */\n\tsupportedEventTypes: Record<EntryControlEventTypes, string>;\n}\n\nexport type ZWaveNotificationCallbackArgs_BatteryCC = {\n\teventType: \"battery low\";\n\turgency: BatteryReplacementStatus.Soon | BatteryReplacementStatus.Now;\n};\n\n/**\n * Parameter types for the Battery CC specific version of ZWaveNotificationCallback\n */\nexport type ZWaveNotificationCallbackParams_BatteryCC = [\n\tendpoint: Endpoint,\n\tccId: (typeof CommandClasses.Battery),\n\targs: ZWaveNotificationCallbackArgs_BatteryCC,\n];\n\nexport type ZWaveNotificationCallback = (\n\t...args:\n\t\t| ZWaveNotificationCallbackParams_NotificationCC\n\t\t| ZWaveNotificationCallbackParams_EntryControlCC\n\t\t| ZWaveNotificationCallbackParams_PowerlevelCC\n\t\t| ZWaveNotificationCallbackParams_MultilevelSwitchCC\n\t\t| ZWaveNotificationCallbackParams_BatteryCC\n) => void;\n\nexport type ZWaveNotificationCapability =\n\t| ZWaveNotificationCapability_NotificationCC\n\t| ZWaveNotificationCapability_EntryControlCC;\n\nexport interface ZWaveNodeValueEventCallbacks {\n\t\"value added\": ZWaveNodeValueAddedCallback;\n\t\"value updated\": ZWaveNodeValueUpdatedCallback;\n\t\"value removed\": ZWaveNodeValueRemovedCallback;\n\t\"metadata updated\": ZWaveNodeMetadataUpdatedCallback;\n\t\"value notification\": ZWaveNodeValueNotificationCallback;\n}\n\nexport interface UserDeletedArgs {\n\tuserId: number;\n}\n\nexport interface CredentialChangedArgs {\n\tuserId: number;\n\tcredentialType: UserCredentialType;\n\tcredentialSlot: number;\n\tdata?: string | Uint8Array;\n}\n\nexport interface CredentialDeletedArgs {\n\tuserId: number;\n\tcredentialType: UserCredentialType;\n\tcredentialSlot: number;\n}\n\nexport interface CredentialLearnProgressArgs {\n\tuserId: number;\n\tcredentialType: UserCredentialType;\n\tcredentialSlot: number;\n\tstepsRemaining: number;\n\tstatus: UserCredentialLearnStatus;\n}\n\nexport interface CredentialLearnCompletedArgs {\n\tuserId: number;\n\tcredentialType: UserCredentialType;\n\tcredentialSlot: number;\n\tstatus: UserCredentialLearnStatus;\n\tsuccess: boolean;\n}\n\nexport interface ZWaveNodeEventCallbacks extends ZWaveNodeValueEventCallbacks {\n\tnotification: ZWaveNotificationCallback;\n\t\"interview failed\": ZWaveInterviewFailedCallback;\n\t\"firmware update progress\": ZWaveNodeFirmwareUpdateProgressCallback;\n\t\"firmware update finished\": ZWaveNodeFirmwareUpdateFinishedCallback;\n\t\"wake up\": ZWaveNodeStatusChangeCallback;\n\tsleep: ZWaveNodeStatusChangeCallback;\n\tdead: ZWaveNodeStatusChangeCallback;\n\talive: ZWaveNodeStatusChangeCallback;\n\t\"interview completed\": (node: ZWaveNode) => void;\n\tready: (node: ZWaveNode) => void;\n\t\"interview stage completed\": (node: ZWaveNode, stageName: string) => void;\n\t\"interview started\": (node: ZWaveNode) => void;\n\t\"node info received\": (node: ZWaveNode) => void;\n\t\"user added\": (endpoint: Endpoint, args: UserData) => void;\n\t\"user modified\": (endpoint: Endpoint, args: UserData) => void;\n\t\"user deleted\": (endpoint: Endpoint, args: UserDeletedArgs) => void;\n\t\"credential added\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialChangedArgs,\n\t) => void;\n\t\"credential modified\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialChangedArgs,\n\t) => void;\n\t\"credential deleted\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialDeletedArgs,\n\t) => void;\n\t\"credential learn progress\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialLearnProgressArgs,\n\t) => void;\n\t\"credential learn completed\": (\n\t\tendpoint: Endpoint,\n\t\targs: CredentialLearnCompletedArgs,\n\t) => void;\n}\n\nexport type ZWaveNodeEvents = Extract<keyof ZWaveNodeEventCallbacks, string>;\n\nexport const zWaveNodeEvents = [\n\t\"notification\",\n\t\"interview failed\",\n\t\"firmware update progress\",\n\t\"firmware update finished\",\n\t\"wake up\",\n\t\"sleep\",\n\t\"dead\",\n\t\"alive\",\n\t\"interview completed\",\n\t\"ready\",\n\t\"interview stage completed\",\n\t\"interview started\",\n\t\"value added\",\n\t\"value updated\",\n\t\"value removed\",\n\t\"metadata updated\",\n\t\"value notification\",\n\t\"user added\",\n\t\"user modified\",\n\t\"user deleted\",\n\t\"credential added\",\n\t\"credential modified\",\n\t\"credential deleted\",\n\t\"credential learn progress\",\n\t\"credential learn completed\",\n] as const satisfies readonly ZWaveNodeEvents[];\n\n/** Represents the result of one health check round of a node's lifeline */\nexport interface LifelineHealthCheckResult {\n\t/**\n\t * How many times at least one new route was needed. Lower = better, ideally 0.\n\t *\n\t * Only available if the controller supports TX reports.\n\t */\n\trouteChanges?: number;\n\t/**\n\t * The maximum time it took to send a ping to the node. Lower = better, ideally 10 ms.\n\t *\n\t * Will use the time in TX reports if available, otherwise fall back to measuring the round trip time.\n\t */\n\tlatency: number;\n\n\t/**\n\t * How many routing neighbors this node has (Z-Wave Classic only). Higher = better, ideally > 2.\n\t * For Z-Wave LR, this is undefined.\n\t */\n\tnumNeighbors?: number;\n\n\t/**\n\t * How many pings were not ACKed by the node. Lower = better, ideally 0.\n\t */\n\tfailedPingsNode: number;\n\n\t/**\n\t * The minimum powerlevel where all pings from the node were ACKed by the controller. Higher = better, ideally 6dBm or more.\n\t *\n\t * Only available if the node supports Powerlevel CC\n\t */\n\tminPowerlevel?: Powerlevel;\n\t/**\n\t * If no powerlevel was found where the controller ACKed all pings from the node, this contains the number of pings that weren't ACKed. Lower = better, ideally 0.\n\t *\n\t * Only available if the node supports Powerlevel CC\n\t */\n\tfailedPingsController?: number;\n\n\t/**\n\t * An estimation of the Signal-to-Noise Ratio Margin in dBm.\n\t *\n\t * Only available if the controller supports TX reports.\n\t */\n\tsnrMargin?: number;\n\n\t/** See {@link LifelineHealthCheckSummary.rating} */\n\trating: number;\n}\n\nexport interface LifelineHealthCheckSummary {\n\t/** The check results of each round */\n\tresults: LifelineHealthCheckResult[];\n\t/**\n\t * The health rating expressed as a number from 0 (not working at all) to 10 (perfect connectivity).\n\t * The rating is calculated evaluating the test results of the worst round similar to Silabs' PC controller.\n\t * Each rating is only achieved if all the requirements are fulfilled.\n\t *\n\t * | Rating | Failed pings | Latency | No. of neighbors | min. powerlevel | SNR margin |\n\t * | -----: | -----------: | ------------: | ---------------: | --------------: | ---------: |\n\t * | \u2705 10 | 0 | \u2264 50 ms | > 2 | \u2264 \u22126 dBm | \u2265 17 dBm |\n\t * | \uD83D\uDFE2 9 | 0 | \u2264 100 ms | > 2 | \u2264 \u22126 dBm | \u2265 17 dBm |\n\t * | \uD83D\uDFE2 8 | 0 | \u2264 100 ms | \u2264 2 | \u2264 \u22126 dBm | \u2265 17 dBm |\n\t * | \uD83D\uDFE2 7 | 0 | \u2264 100 ms | > 2 | - | - |\n\t * | \uD83D\uDFE2 6 | 0 | \u2264 100 ms | \u2264 2 | - | - |\n\t * | | | | | | |\n\t * | \uD83D\uDFE1 5 | 0 | \u2264 250 ms | - | - | - |\n\t * | \uD83D\uDFE1 4 | 0 | \u2264 500 ms | - | - | - |\n\t * | | | | | | |\n\t * | \uD83D\uDD34 3 | 1 | \u2264 1000 ms | - | - | - |\n\t * | \uD83D\uDD34 2 | \u2264 2 | > 1000 ms | - | - | - |\n\t * | \uD83D\uDD34 1 | \u2264 9 | - | - | - | - |\n\t * | | | | | | |\n\t * | \u274C 0 | 10 | - | - | - | - |\n\t *\n\t * If the min. powerlevel or SNR margin can not be measured, the condition is assumed to be fulfilled.\n\t * The no. of neighbors is only relevant for Z-Wave Classic. The condition is assumed to be fulfilled for Z-Wave LR.\n\t */\n\trating: number;\n}\n\n/** Represents the result of one health check round of a route between two nodes */\nexport interface RouteHealthCheckResult {\n\t/** How many routing neighbors this node has. Higher = better, ideally > 2. */\n\tnumNeighbors: number;\n\t/**\n\t * How many pings were not ACKed by the target node. Lower = better, ideally 0.\n\t *\n\t * Only available if the source node supports Powerlevel CC\n\t */\n\tfailedPingsToTarget?: number;\n\t/**\n\t * How many pings were not ACKed by the source node. Lower = better, ideally 0.\n\t *\n\t * Only available if the target node supports Powerlevel CC\n\t */\n\tfailedPingsToSource?: number;\n\t/**\n\t * The minimum powerlevel where all pings from the source node were ACKed by the target node. Higher = better, ideally 6dBm or more.\n\t *\n\t * Only available if the source node supports Powerlevel CC\n\t */\n\tminPowerlevelSource?: Powerlevel;\n\t/**\n\t * The minimum powerlevel where all pings from the target node were ACKed by the source node. Higher = better, ideally 6dBm or more.\n\t *\n\t * Only available if the source node supports Powerlevel CC\n\t */\n\tminPowerlevelTarget?: Powerlevel;\n\n\t/** See {@link RouteHealthCheckSummary.rating} */\n\trating: number;\n}\n\nexport interface RouteHealthCheckSummary {\n\t/** The check results of each round */\n\tresults: RouteHealthCheckResult[];\n\t/**\n\t * The health rating expressed as a number from 0 (not working at all) to 10 (perfect connectivity).\n\t * See {@link LifelineHealthCheckSummary.rating} for a detailed description.\n\t *\n\t * Because the connection between two nodes can only be evaluated with successful pings, the ratings 4, 5 and 9\n\t * cannot be achieved in this test:\n\t *\n\t * | Rating | Failed pings | No. of neighbors | min. powerlevel |\n\t * | -----: | -----------: | ---------------: | --------------: |\n\t * | \u2705 10 | 0 | > 2 | \u2264 \u22126 dBm |\n\t * | \uD83D\uDFE2 8 | 0 | \u2264 2 | \u2264 \u22126 dBm |\n\t * | \uD83D\uDFE2 7 | 0 | > 2 | - |\n\t * | \uD83D\uDFE2 6 | 0 | \u2264 2 | - |\n\t * | | | | |\n\t * | \uD83D\uDD34 3 | 1 | - | - |\n\t * | \uD83D\uDD34 2 | 2 | - | - |\n\t * | \uD83D\uDD34 1 | \u2264 9 | - | - |\n\t * | | | | |\n\t * | \u274C 0 | 10 | - | - |\n\t */\n\trating: number;\n}\n\nexport enum LinkReliabilityCheckMode {\n\tBasicSetOnOff,\n}\n\nexport interface LinkReliabilityCheckOptions {\n\tmode: LinkReliabilityCheckMode;\n\tinterval: number;\n\trounds?: number;\n\tonProgress?: (progress: LinkReliabilityCheckResult) => void;\n}\n\nexport interface LinkReliabilityCheckResult {\n\trounds: number;\n\n\tcommandsSent: number;\n\tcommandErrors: number;\n\tmissingResponses?: number;\n\n\tlatency?: {\n\t\tmin: number;\n\t\tmax: number;\n\t\taverage: number;\n\t};\n\n\trtt: {\n\t\tmin: number;\n\t\tmax: number;\n\t\taverage: number;\n\t};\n\n\tackRSSI: {\n\t\tmin: number;\n\t\tmax: number;\n\t\taverage: number;\n\t};\n\n\tresponseRSSI?: {\n\t\tmin: number;\n\t\tmax: number;\n\t\taverage: number;\n\t};\n}\n\nexport interface RefreshInfoOptions {\n\t/**\n\t * Whether a re-interview should also reset the known security classes.\n\t * Default: false\n\t */\n\tresetSecurityClasses?: boolean;\n\n\t/**\n\t * Whether the information about sleeping nodes should only be reset when the node wakes up.\n\t * Default: true\n\t */\n\twaitForWakeup?: boolean;\n}\n\n/** The last known routes between the controller and a node */\nexport interface LifelineRoutes {\n\t/** The last working route from the controller to this node. */\n\tlwr?: RouteStatistics;\n\t/** The next to last working route from the controller to this node. */\n\tnlwr?: RouteStatistics;\n}\n\nexport type DateAndTime =\n\t& AllOrNone<{\n\t\thour: number;\n\t\tminute: number;\n\t}>\n\t& (\n\t\t| { weekday?: Weekday; second?: undefined }\n\t\t| { weekday?: undefined; second?: number }\n\t)\n\t& AllOrNone<{\n\t\tyear: number;\n\t\tmonth: number;\n\t\tday: number;\n\t}>\n\t& AllOrNone<{\n\t\tdstOffset: number;\n\t\tstandardOffset: number;\n\t}>;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AA8BA;;;;;;;;;;;;;;;AAAA,gBAOO;AACP,kBAA6D;AAkRtD,MAAM,kBAAkB;EAC9B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AA+ID,IAAY;CAAZ,SAAYA,2BAAwB;AACnC,EAAAA,0BAAAA,0BAAA,eAAA,IAAA,CAAA,IAAA;AACD,GAFY,6BAAA,2BAAwB,CAAA,EAAA;",
6
6
  "names": ["LinkReliabilityCheckMode"]
7
7
  }
@@ -1,4 +1,14 @@
1
- import { AccessControlMixin } from "./05_AccessControl.js";
2
- export declare class EndpointMixins extends AccessControlMixin {
1
+ import { AccessControlAPI } from "../feature-apis/AccessControl.js";
2
+ import { EndpointBase } from "./00_Base.js";
3
+ export declare class FeatureAPIsMixin extends EndpointBase {
4
+ private _accessControl?;
5
+ /**
6
+ * High-level API for managing users and credentials on access control
7
+ * devices. Returns `undefined` if the endpoint supports neither the
8
+ * **User Credential CC** nor the **User Code CC**.
9
+ */
10
+ get accessControl(): AccessControlAPI | undefined;
11
+ }
12
+ export declare class EndpointMixins extends FeatureAPIsMixin {
3
13
  }
4
14
  //# sourceMappingURL=index.d.ts.map
@@ -19,17 +19,39 @@ var __copyProps = (to, from, except, desc) => {
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
20
  var endpoint_mixins_exports = {};
21
21
  __export(endpoint_mixins_exports, {
22
- EndpointMixins: () => EndpointMixins
22
+ EndpointMixins: () => EndpointMixins,
23
+ FeatureAPIsMixin: () => FeatureAPIsMixin
23
24
  });
24
25
  module.exports = __toCommonJS(endpoint_mixins_exports);
25
- var import_AccessControl = require("./05_AccessControl.js");
26
- class EndpointMixins extends import_AccessControl.AccessControlMixin {
26
+ var import_core = require("@zwave-js/core");
27
+ var import_AccessControl = require("../feature-apis/AccessControl.js");
28
+ var import_Base = require("./00_Base.js");
29
+ class FeatureAPIsMixin extends import_Base.EndpointBase {
30
+ static {
31
+ __name(this, "FeatureAPIsMixin");
32
+ }
33
+ _accessControl;
34
+ /**
35
+ * High-level API for managing users and credentials on access control
36
+ * devices. Returns `undefined` if the endpoint supports neither the
37
+ * **User Credential CC** nor the **User Code CC**.
38
+ */
39
+ get accessControl() {
40
+ if (!this.supportsCC(import_core.CommandClasses["User Credential"]) && !this.supportsCC(import_core.CommandClasses["User Code"])) {
41
+ return void 0;
42
+ }
43
+ this._accessControl ??= new import_AccessControl.AccessControlAPI(this);
44
+ return this._accessControl;
45
+ }
46
+ }
47
+ class EndpointMixins extends FeatureAPIsMixin {
27
48
  static {
28
49
  __name(this, "EndpointMixins");
29
50
  }
30
51
  }
31
52
  // Annotate the CommonJS export names for ESM import in node:
32
53
  0 && (module.exports = {
33
- EndpointMixins
54
+ EndpointMixins,
55
+ FeatureAPIsMixin
34
56
  });
35
57
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/lib/node/endpoint-mixins/index.ts"],
4
- "sourcesContent": ["import { AccessControlMixin } from \"./05_AccessControl.js\";\n\nexport class EndpointMixins extends AccessControlMixin {}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAA,2BAAmC;AAE7B,MAAO,uBAAuB,wCAAkB;EAFtD,OAEsD;;;;",
4
+ "sourcesContent": ["import { CommandClasses } from \"@zwave-js/core\";\nimport { AccessControlAPI } from \"../feature-apis/AccessControl.js\";\nimport { EndpointBase } from \"./00_Base.js\";\n\nexport class FeatureAPIsMixin extends EndpointBase {\n\tprivate _accessControl?: AccessControlAPI;\n\n\t/**\n\t * High-level API for managing users and credentials on access control\n\t * devices. Returns `undefined` if the endpoint supports neither the\n\t * **User Credential CC** nor the **User Code CC**.\n\t */\n\tpublic get accessControl(): AccessControlAPI | undefined {\n\t\tif (\n\t\t\t!this.supportsCC(CommandClasses[\"User Credential\"])\n\t\t\t&& !this.supportsCC(CommandClasses[\"User Code\"])\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\t\tthis._accessControl ??= new AccessControlAPI(this);\n\t\treturn this._accessControl;\n\t}\n}\n\nexport class EndpointMixins extends FeatureAPIsMixin {}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAAA,kBAA+B;AAC/B,2BAAiC;AACjC,kBAA6B;AAEvB,MAAO,yBAAyB,yBAAY;EAJlD,OAIkD;;;EACzC;;;;;;EAOR,IAAW,gBAAa;AACvB,QACC,CAAC,KAAK,WAAW,2BAAe,iBAAiB,CAAC,KAC/C,CAAC,KAAK,WAAW,2BAAe,WAAW,CAAC,GAC9C;AACD,aAAO;IACR;AACA,SAAK,mBAAmB,IAAI,sCAAiB,IAAI;AACjD,WAAO,KAAK;EACb;;AAGK,MAAO,uBAAuB,iBAAgB;EAxBpD,OAwBoD;;;;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { type UserCredentialCapability, UserCredentialRule, UserCredentialType, UserCredentialUserType } from "@zwave-js/cc";
2
2
  import { type SupervisionResult } from "@zwave-js/core";
3
- import { EndpointBase } from "./00_Base.js";
3
+ import { FeatureAPI } from "./FeatureAPI.js";
4
4
  export interface UserCapabilities {
5
5
  maxUsers: number;
6
6
  supportedUserTypes: readonly UserCredentialUserType[];
@@ -33,18 +33,19 @@ export interface SetUserOptions {
33
33
  credentialRule?: UserCredentialRule;
34
34
  expiringTimeoutMinutes?: number;
35
35
  }
36
- /** Defines functionality of Z-Wave endpoints related to managing users and credentials for access control */
37
- export interface EndpointAccessControl {
36
+ /** High-level API for managing users and credentials on access control devices */
37
+ export declare class AccessControlAPI extends FeatureAPI {
38
+ #private;
38
39
  /**
39
40
  * Returns the user-related capabilities of this endpoint.
40
41
  * This method uses cached information from the most recent interview.
41
42
  */
42
- getUserCapabilitiesCached(): UserCapabilities | undefined;
43
+ getUserCapabilitiesCached(): UserCapabilities;
43
44
  /**
44
45
  * Returns the credential-related capabilities of this endpoint.
45
46
  * This method uses cached information from the most recent interview.
46
47
  */
47
- getCredentialCapabilitiesCached(): CredentialCapabilities | undefined;
48
+ getCredentialCapabilitiesCached(): CredentialCapabilities;
48
49
  /**
49
50
  * Returns the data for the user with the given ID.
50
51
  * This communicates with the node to retrieve fresh information.
@@ -134,47 +135,4 @@ export interface EndpointAccessControl {
134
135
  */
135
136
  setAdminCode(code: string): Promise<SupervisionResult | undefined>;
136
137
  }
137
- export declare class AccessControlMixin extends EndpointBase implements EndpointAccessControl {
138
- /** Read a cached value from the node's value DB */
139
- private _getValue;
140
- private get _usesUserCredentialCC();
141
- private get _usesUserCodeCC();
142
- getUserCapabilitiesCached(): UserCapabilities | undefined;
143
- getCredentialCapabilitiesCached(): CredentialCapabilities | undefined;
144
- getUser(userId: number): Promise<UserData | undefined>;
145
- getUserCached(userId: number): UserData | undefined;
146
- getUsers(): Promise<UserData[]>;
147
- getUsersCached(): UserData[];
148
- setUser(userId: number, options: SetUserOptions): Promise<SupervisionResult | undefined>;
149
- deleteUser(userId: number): Promise<SupervisionResult | undefined>;
150
- deleteAllUsers(): Promise<SupervisionResult | undefined>;
151
- getCredential(userId: number, type: UserCredentialType, slot: number): Promise<CredentialData | undefined>;
152
- getCredentialCached(userId: number, type: UserCredentialType, slot: number): CredentialData | undefined;
153
- getCredentials(userId: number): Promise<CredentialData[]>;
154
- getCredentialsCached(userId: number): CredentialData[];
155
- setCredential(userId: number, type: UserCredentialType, slot: number, data: string | Uint8Array): Promise<SupervisionResult | undefined>;
156
- deleteCredential(userId: number, type: UserCredentialType, slot: number): Promise<SupervisionResult | undefined>;
157
- startCredentialLearn(userId: number, type: UserCredentialType, slot: number, timeout?: number): Promise<SupervisionResult | undefined>;
158
- cancelCredentialLearn(): Promise<SupervisionResult | undefined>;
159
- getAdminCode(): Promise<string | undefined>;
160
- setAdminCode(code: string): Promise<SupervisionResult | undefined>;
161
- private _ucAPI;
162
- private _u3cAPI;
163
- /** Returns the credential type to use for User Code CC based on supported characters */
164
- private get _ucCredentialType();
165
- /** Maps User Code CC's UserIDStatus to the unified active/userType model */
166
- private _mapUserCodeStatusToUserData;
167
- /** Removes cached credential values for a given user from the value DB */
168
- private _purgeCachedCredentials;
169
- /** Removes all cached user and credential values from the value DB */
170
- private _purgeAllCachedUsersAndCredentials;
171
- /** Removes all cached user code status and code values from the value DB */
172
- private _purgeAllCachedUserCodes;
173
- private _assertValidSlot;
174
- private _throwNoAccessControl;
175
- private _getUserCached_U3C;
176
- private _getCredentialCached_U3C;
177
- private _getUserCached_UC;
178
- private _getCredentialCached_UC;
179
- }
180
- //# sourceMappingURL=05_AccessControl.d.ts.map
138
+ //# sourceMappingURL=AccessControl.d.ts.map