zwave-js 15.10.0 → 15.11.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.
- package/build/cjs/lib/_version.d.ts +1 -1
- package/build/cjs/lib/_version.js +1 -1
- package/build/cjs/lib/_version.js.map +1 -1
- package/build/cjs/lib/controller/Controller.js +60 -5
- package/build/cjs/lib/controller/Controller.js.map +2 -2
- package/build/cjs/lib/controller/ControllerStatistics.d.ts +1 -0
- package/build/cjs/lib/controller/ControllerStatistics.js +15 -0
- package/build/cjs/lib/controller/ControllerStatistics.js.map +2 -2
- package/build/cjs/lib/driver/Driver.js +11 -1
- package/build/cjs/lib/driver/Driver.js.map +2 -2
- package/build/cjs/lib/driver/Statistics.d.ts +2 -0
- package/build/cjs/lib/driver/Statistics.js +5 -1
- package/build/cjs/lib/driver/Statistics.js.map +2 -2
- package/build/cjs/lib/driver/ZWaveOptions.d.ts +5 -1
- package/build/cjs/lib/driver/ZWaveOptions.js.map +2 -2
- package/build/cjs/lib/zniffer/Zniffer.js +1 -0
- package/build/cjs/lib/zniffer/Zniffer.js.map +2 -2
- package/build/esm/lib/_version.d.ts +1 -1
- package/build/esm/lib/_version.js +1 -1
- package/build/esm/lib/controller/Controller.d.ts.map +1 -1
- package/build/esm/lib/controller/Controller.js +82 -5
- package/build/esm/lib/controller/Controller.js.map +1 -1
- package/build/esm/lib/controller/ControllerStatistics.d.ts +1 -0
- package/build/esm/lib/controller/ControllerStatistics.d.ts.map +1 -1
- package/build/esm/lib/controller/ControllerStatistics.js +16 -0
- package/build/esm/lib/controller/ControllerStatistics.js.map +1 -1
- package/build/esm/lib/driver/Driver.d.ts.map +1 -1
- package/build/esm/lib/driver/Driver.js +12 -0
- package/build/esm/lib/driver/Driver.js.map +1 -1
- package/build/esm/lib/driver/Statistics.d.ts +2 -0
- package/build/esm/lib/driver/Statistics.d.ts.map +1 -1
- package/build/esm/lib/driver/Statistics.js +6 -1
- package/build/esm/lib/driver/Statistics.js.map +1 -1
- package/build/esm/lib/driver/ZWaveOptions.d.ts +5 -1
- package/build/esm/lib/driver/ZWaveOptions.d.ts.map +1 -1
- package/build/esm/lib/driver/ZWaveOptions.js.map +1 -1
- package/build/esm/lib/zniffer/Zniffer.d.ts.map +1 -1
- package/build/esm/lib/zniffer/Zniffer.js +1 -1
- package/build/esm/lib/zniffer/Zniffer.js.map +1 -1
- package/package.json +11 -11
|
@@ -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.
|
|
25
|
+
const PACKAGE_VERSION = "15.11.0";
|
|
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.
|
|
4
|
+
"sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"15.11.0\";\nexport const PACKAGE_NAME = \"zwave-js\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;;AACO,MAAM,kBAAkB;AACxB,MAAM,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -491,6 +491,12 @@ let ZWaveController = (() => {
|
|
|
491
491
|
set provisioningList(value) {
|
|
492
492
|
this.driver.cacheSet(import_NetworkCache.cacheKeys.controller.provisioningList, value);
|
|
493
493
|
}
|
|
494
|
+
/** @internal Tracks the number of failed SmartStart inclusion attempts per DSK */
|
|
495
|
+
_smartStartFailedAttempts = /* @__PURE__ */ new Map();
|
|
496
|
+
/** @internal Resets the SmartStart inclusion failure counter for the given DSK */
|
|
497
|
+
resetSmartStartFailureCount(dsk) {
|
|
498
|
+
this._smartStartFailedAttempts.delete(dsk);
|
|
499
|
+
}
|
|
494
500
|
/** Adds the given entry (DSK and security classes) to the controller's SmartStart provisioning list or replaces an existing entry */
|
|
495
501
|
provisionSmartStartNode(entry) {
|
|
496
502
|
this.assertFeature(import_Features.ZWaveFeature.SmartStart);
|
|
@@ -503,6 +509,7 @@ let ZWaveController = (() => {
|
|
|
503
509
|
provisioningList[index] = entry;
|
|
504
510
|
}
|
|
505
511
|
this.provisioningList = provisioningList;
|
|
512
|
+
this.resetSmartStartFailureCount(entry.dsk);
|
|
506
513
|
this.autoProvisionSmartStart();
|
|
507
514
|
}
|
|
508
515
|
/**
|
|
@@ -519,6 +526,7 @@ let ZWaveController = (() => {
|
|
|
519
526
|
if (index >= 0) {
|
|
520
527
|
provisioningList.splice(index, 1);
|
|
521
528
|
this.provisioningList = provisioningList;
|
|
529
|
+
this.resetSmartStartFailureCount(entry.dsk);
|
|
522
530
|
this.autoProvisionSmartStart();
|
|
523
531
|
}
|
|
524
532
|
}
|
|
@@ -1398,6 +1406,33 @@ let ZWaveController = (() => {
|
|
|
1398
1406
|
}
|
|
1399
1407
|
}
|
|
1400
1408
|
if (smartStartFailed) {
|
|
1409
|
+
if (opts.strategy === import_Inclusion.InclusionStrategy.SmartStart && opts.provisioning?.dsk) {
|
|
1410
|
+
const dsk = opts.provisioning.dsk;
|
|
1411
|
+
const maxAttempts = this.driver.options.attempts.smartStartInclusion;
|
|
1412
|
+
const currentAttempts = this._smartStartFailedAttempts.get(dsk) || 0;
|
|
1413
|
+
const newAttempts = currentAttempts + 1;
|
|
1414
|
+
this._smartStartFailedAttempts.set(dsk, newAttempts);
|
|
1415
|
+
this.driver.controllerLog.logNode(newNode.id, {
|
|
1416
|
+
message: `SmartStart inclusion failed for DSK ${dsk} (attempt ${newAttempts}/${maxAttempts}).`,
|
|
1417
|
+
level: "warn"
|
|
1418
|
+
});
|
|
1419
|
+
if (newAttempts >= maxAttempts) {
|
|
1420
|
+
const provisioningList = [...this.provisioningList];
|
|
1421
|
+
const entryIndex = provisioningList.findIndex((e) => e.dsk === dsk);
|
|
1422
|
+
if (entryIndex >= 0) {
|
|
1423
|
+
provisioningList[entryIndex] = {
|
|
1424
|
+
...provisioningList[entryIndex],
|
|
1425
|
+
status: import_Inclusion.ProvisioningEntryStatus.Inactive
|
|
1426
|
+
};
|
|
1427
|
+
this.provisioningList = provisioningList;
|
|
1428
|
+
this.resetSmartStartFailureCount(dsk);
|
|
1429
|
+
this.driver.controllerLog.logNode(newNode.id, {
|
|
1430
|
+
message: `Provisioning entry for DSK ${dsk} has been disabled after ${maxAttempts} failed inclusion attempts.`,
|
|
1431
|
+
level: "warn"
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1401
1436
|
try {
|
|
1402
1437
|
this.driver.controllerLog.logNode(newNode.id, {
|
|
1403
1438
|
message: "SmartStart inclusion failed. Checking if the node needs to be removed.",
|
|
@@ -1421,6 +1456,12 @@ let ZWaveController = (() => {
|
|
|
1421
1456
|
lowSecurity: true,
|
|
1422
1457
|
lowSecurityReason: bootstrapFailure
|
|
1423
1458
|
} : { lowSecurity: false };
|
|
1459
|
+
if (opts.strategy === import_Inclusion.InclusionStrategy.SmartStart && opts.provisioning?.dsk) {
|
|
1460
|
+
const dsk = opts.provisioning.dsk;
|
|
1461
|
+
if (this._smartStartFailedAttempts.has(dsk)) {
|
|
1462
|
+
this._smartStartFailedAttempts.delete(dsk);
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1424
1465
|
this.emit("node added", newNode, result);
|
|
1425
1466
|
}
|
|
1426
1467
|
/**
|
|
@@ -4623,7 +4664,8 @@ let ZWaveController = (() => {
|
|
|
4623
4664
|
}
|
|
4624
4665
|
const ret = new import_shared.Bytes(size);
|
|
4625
4666
|
let offset = 0;
|
|
4626
|
-
|
|
4667
|
+
const initialChunkSize = this._manufacturerId === 134 && this._productType === 1 && this._productId === 90 ? 48 : 65535;
|
|
4668
|
+
let chunkSize = Math.min(initialChunkSize, ret.length);
|
|
4627
4669
|
while (offset < ret.length) {
|
|
4628
4670
|
const chunk = await this.externalNVMReadBuffer(offset, Math.min(chunkSize, ret.length - offset));
|
|
4629
4671
|
if (chunk.length === 0) {
|
|
@@ -4698,15 +4740,24 @@ let ZWaveController = (() => {
|
|
|
4698
4740
|
throw new import_core.ZWaveError("Could not turn off the Z-Wave radio before restoring NVM backup!", import_core.ZWaveErrorCodes.Controller_ResponseNOK);
|
|
4699
4741
|
}
|
|
4700
4742
|
await this.stopWatchdog();
|
|
4743
|
+
this.driver.controllerLog.print("Converting NVM to target format...");
|
|
4744
|
+
let targetNVM;
|
|
4745
|
+
let convertedNVM;
|
|
4701
4746
|
try {
|
|
4702
|
-
this.driver.controllerLog.print("Converting NVM to target format...");
|
|
4703
|
-
let targetNVM;
|
|
4704
4747
|
if (this.sdkVersionGte("7.0")) {
|
|
4705
4748
|
targetNVM = await this.backupNVMRaw700(convertProgress);
|
|
4706
4749
|
} else {
|
|
4707
4750
|
targetNVM = await this.backupNVMRaw500(convertProgress);
|
|
4708
4751
|
}
|
|
4709
|
-
|
|
4752
|
+
convertedNVM = await (0, import_nvmedit.migrateNVM)(nvmData, targetNVM, migrateOptions);
|
|
4753
|
+
} catch (e) {
|
|
4754
|
+
await this.toggleRF(true);
|
|
4755
|
+
const message = "Failed to convert NVM to target format: " + e.message;
|
|
4756
|
+
this.driver.controllerLog.print(message, "error");
|
|
4757
|
+
e.message = message;
|
|
4758
|
+
throw e;
|
|
4759
|
+
}
|
|
4760
|
+
try {
|
|
4710
4761
|
this.driver.controllerLog.print("Restoring NVM backup...");
|
|
4711
4762
|
if (this.sdkVersionGte("7.0")) {
|
|
4712
4763
|
await this.restoreNVMRaw700(convertedNVM, restoreProgress);
|
|
@@ -4714,8 +4765,12 @@ let ZWaveController = (() => {
|
|
|
4714
4765
|
await this.restoreNVMRaw500(convertedNVM, restoreProgress);
|
|
4715
4766
|
}
|
|
4716
4767
|
this.driver.controllerLog.print("NVM backup restored. Restarting to activate the restored backup...");
|
|
4717
|
-
} catch {
|
|
4768
|
+
} catch (e) {
|
|
4718
4769
|
await this.toggleRF(true);
|
|
4770
|
+
const message = "Failed to restore NVM backup: " + e.message;
|
|
4771
|
+
this.driver.controllerLog.print(message, "error");
|
|
4772
|
+
e.message = message;
|
|
4773
|
+
throw e;
|
|
4719
4774
|
}
|
|
4720
4775
|
this._nodes.clear();
|
|
4721
4776
|
await this.driver.softResetAndRestart();
|