zwave-js 14.2.0 → 14.3.0

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.
@@ -507,10 +507,10 @@ class Driver extends import_shared.TypedEventEmitter {
507
507
  if (this._learnModeAuthenticatedKeyPair == void 0) {
508
508
  const privateKey = this.cacheGet(import_NetworkCache.cacheKeys.controller.privateKey);
509
509
  if (privateKey) {
510
- this._learnModeAuthenticatedKeyPair = (0, import_core.keyPairFromRawECDHPrivateKey)(privateKey);
510
+ this._learnModeAuthenticatedKeyPair = (0, import_core.keyPairFromRawECDHPrivateKeySync)(privateKey);
511
511
  } else {
512
- this._learnModeAuthenticatedKeyPair = (0, import_core.generateECDHKeyPair)();
513
- this.cacheSet(import_NetworkCache.cacheKeys.controller.privateKey, (0, import_core.extractRawECDHPrivateKey)(this._learnModeAuthenticatedKeyPair.privateKey));
512
+ this._learnModeAuthenticatedKeyPair = (0, import_core.generateECDHKeyPairSync)();
513
+ this.cacheSet(import_NetworkCache.cacheKeys.controller.privateKey, (0, import_core.extractRawECDHPrivateKeySync)(this._learnModeAuthenticatedKeyPair.privateKey));
514
514
  }
515
515
  }
516
516
  return this._learnModeAuthenticatedKeyPair;
@@ -962,7 +962,7 @@ class Driver extends import_shared.TypedEventEmitter {
962
962
  }
963
963
  if (this._options.securityKeys && Object.keys(this._options.securityKeys).some((key) => key.startsWith("S2_") && key in import_core.SecurityClass && (0, import_core.securityClassIsS2)(import_core.SecurityClass[key]))) {
964
964
  this.driverLog.print("At least one network key for S2 configured, enabling S2 security manager...");
965
- this._securityManager2 = new import_core.SecurityManager2();
965
+ this._securityManager2 = await import_core.SecurityManager2.create();
966
966
  for (const secClass of [
967
967
  "S2_Unauthenticated",
968
968
  "S2_Authenticated",
@@ -971,7 +971,7 @@ class Driver extends import_shared.TypedEventEmitter {
971
971
  ]) {
972
972
  const key = this._options.securityKeys[secClass];
973
973
  if (key) {
974
- this._securityManager2.setKey(import_core.SecurityClass[secClass], key);
974
+ await this._securityManager2.setKeyAsync(import_core.SecurityClass[secClass], key);
975
975
  }
976
976
  }
977
977
  } else {
@@ -979,12 +979,12 @@ class Driver extends import_shared.TypedEventEmitter {
979
979
  }
980
980
  if (this._options.securityKeysLongRange?.S2_AccessControl || this._options.securityKeysLongRange?.S2_Authenticated) {
981
981
  this.driverLog.print("At least one network key for Z-Wave Long Range configured, enabling security manager...");
982
- this._securityManagerLR = new import_core.SecurityManager2();
982
+ this._securityManagerLR = await import_core.SecurityManager2.create();
983
983
  if (this._options.securityKeysLongRange?.S2_AccessControl) {
984
- this._securityManagerLR.setKey(import_core.SecurityClass.S2_AccessControl, this._options.securityKeysLongRange.S2_AccessControl);
984
+ await this._securityManagerLR.setKeyAsync(import_core.SecurityClass.S2_AccessControl, this._options.securityKeysLongRange.S2_AccessControl);
985
985
  }
986
986
  if (this._options.securityKeysLongRange?.S2_Authenticated) {
987
- this._securityManagerLR.setKey(import_core.SecurityClass.S2_Authenticated, this._options.securityKeysLongRange.S2_Authenticated);
987
+ await this._securityManagerLR.setKeyAsync(import_core.SecurityClass.S2_Authenticated, this._options.securityKeysLongRange.S2_Authenticated);
988
988
  }
989
989
  } else {
990
990
  this.driverLog.print("No network key for Z-Wave Long Range configured, communication won't work!", "warn");
@@ -1000,18 +1000,18 @@ class Driver extends import_shared.TypedEventEmitter {
1000
1000
  ]).filter((v) => v[1] != void 0);
1001
1001
  if (securityKeysLongRange.length) {
1002
1002
  this.driverLog.print("At least one network key for Z-Wave Long Range found in cache, enabling security manager...");
1003
- this._securityManagerLR = new import_core.SecurityManager2();
1003
+ this._securityManagerLR = await import_core.SecurityManager2.create();
1004
1004
  for (const [sc, key] of securityKeysLongRange) {
1005
- this._securityManagerLR.setKey(sc, key);
1005
+ await this._securityManagerLR.setKeyAsync(sc, key);
1006
1006
  }
1007
1007
  } else if (this._options.securityKeysLongRange?.S2_AccessControl || this._options.securityKeysLongRange?.S2_Authenticated) {
1008
1008
  this.driverLog.print("Fallback to configured network keys for Z-Wave Long Range, enabling security manager...");
1009
- this._securityManagerLR = new import_core.SecurityManager2();
1009
+ this._securityManagerLR = await import_core.SecurityManager2.create();
1010
1010
  if (this._options.securityKeysLongRange?.S2_AccessControl) {
1011
- this._securityManagerLR.setKey(import_core.SecurityClass.S2_AccessControl, this._options.securityKeysLongRange.S2_AccessControl);
1011
+ await this._securityManagerLR.setKeyAsync(import_core.SecurityClass.S2_AccessControl, this._options.securityKeysLongRange.S2_AccessControl);
1012
1012
  }
1013
1013
  if (this._options.securityKeysLongRange?.S2_Authenticated) {
1014
- this._securityManagerLR.setKey(import_core.SecurityClass.S2_Authenticated, this._options.securityKeysLongRange.S2_Authenticated);
1014
+ await this._securityManagerLR.setKeyAsync(import_core.SecurityClass.S2_Authenticated, this._options.securityKeysLongRange.S2_Authenticated);
1015
1015
  }
1016
1016
  } else {
1017
1017
  this.driverLog.print("No network key for Z-Wave Long Range configured, communication won't work!", "warn");
@@ -1041,13 +1041,13 @@ class Driver extends import_shared.TypedEventEmitter {
1041
1041
  ]).filter((v) => v[1] != void 0);
1042
1042
  if (securityKeys.length) {
1043
1043
  this.driverLog.print("At least one network key for S2 found in cache, enabling S2 security manager...");
1044
- this._securityManager2 = new import_core.SecurityManager2();
1044
+ this._securityManager2 = await import_core.SecurityManager2.create();
1045
1045
  for (const [sc, key] of securityKeys) {
1046
- this._securityManager2.setKey(sc, key);
1046
+ await this._securityManager2.setKeyAsync(sc, key);
1047
1047
  }
1048
1048
  } else if (this._options.securityKeys && Object.keys(this._options.securityKeys).some((key) => key.startsWith("S2_") && key in import_core.SecurityClass && (0, import_core.securityClassIsS2)(import_core.SecurityClass[key]))) {
1049
1049
  this.driverLog.print("Fallback to configured network keys for S2, enabling S2 security manager...");
1050
- this._securityManager2 = new import_core.SecurityManager2();
1050
+ this._securityManager2 = await import_core.SecurityManager2.create();
1051
1051
  for (const secClass of [
1052
1052
  "S2_Unauthenticated",
1053
1053
  "S2_Authenticated",
@@ -1056,7 +1056,7 @@ class Driver extends import_shared.TypedEventEmitter {
1056
1056
  ]) {
1057
1057
  const key = this._options.securityKeys[secClass];
1058
1058
  if (key) {
1059
- this._securityManager2.setKey(import_core.SecurityClass[secClass], key);
1059
+ await this._securityManager2.setKeyAsync(import_core.SecurityClass[secClass], key);
1060
1060
  }
1061
1061
  }
1062
1062
  } else {