zwave-js 14.3.3 → 14.3.4
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 +66 -60
- package/build/cjs/lib/controller/Controller.js.map +1 -1
- package/build/cjs/lib/controller/ControllerStatistics.js +4 -0
- package/build/cjs/lib/controller/ControllerStatistics.js.map +1 -1
- package/build/cjs/lib/controller/FirmwareUpdateService.js +8 -0
- package/build/cjs/lib/controller/FirmwareUpdateService.js.map +1 -1
- package/build/cjs/lib/controller/MockControllerBehaviors.js +3 -0
- package/build/cjs/lib/controller/MockControllerBehaviors.js.map +1 -1
- package/build/cjs/lib/controller/NVMIO.js +7 -0
- package/build/cjs/lib/controller/NVMIO.js.map +1 -1
- package/build/cjs/lib/controller/NodeInformationFrame.js +2 -0
- package/build/cjs/lib/controller/NodeInformationFrame.js.map +1 -1
- package/build/cjs/lib/controller/ZWaveSDKVersions.js +3 -0
- package/build/cjs/lib/controller/ZWaveSDKVersions.js.map +1 -1
- package/build/cjs/lib/controller/utils.js +4 -0
- package/build/cjs/lib/controller/utils.js.map +1 -1
- package/build/cjs/lib/driver/Bootloader.js +4 -0
- package/build/cjs/lib/driver/Bootloader.js.map +1 -1
- package/build/cjs/lib/driver/Driver.js +63 -56
- package/build/cjs/lib/driver/Driver.js.map +1 -1
- package/build/cjs/lib/driver/DriverMock.js +6 -3
- package/build/cjs/lib/driver/DriverMock.js.map +1 -1
- package/build/cjs/lib/driver/MessageGenerators.js +26 -18
- package/build/cjs/lib/driver/MessageGenerators.js.map +1 -1
- package/build/cjs/lib/driver/NetworkCache.js +43 -23
- package/build/cjs/lib/driver/NetworkCache.js.map +1 -1
- package/build/cjs/lib/driver/Queue.js +6 -2
- package/build/cjs/lib/driver/Queue.js.map +1 -1
- package/build/cjs/lib/driver/SerialAPICommandMachine.js +45 -40
- package/build/cjs/lib/driver/SerialAPICommandMachine.js.map +1 -1
- package/build/cjs/lib/driver/StateMachineShared.js +5 -0
- package/build/cjs/lib/driver/StateMachineShared.js.map +1 -1
- package/build/cjs/lib/driver/Statistics.js +4 -0
- package/build/cjs/lib/driver/Statistics.js.map +1 -1
- package/build/cjs/lib/driver/Task.js +9 -2
- package/build/cjs/lib/driver/Task.js.map +1 -1
- package/build/cjs/lib/driver/Transaction.js +8 -4
- package/build/cjs/lib/driver/Transaction.js.map +1 -1
- package/build/cjs/lib/driver/TransportServiceMachine.js +9 -7
- package/build/cjs/lib/driver/TransportServiceMachine.js.map +1 -1
- package/build/cjs/lib/driver/UpdateConfig.js +8 -4
- package/build/cjs/lib/driver/UpdateConfig.js.map +1 -1
- package/build/cjs/lib/driver/UserAgent.js +4 -0
- package/build/cjs/lib/driver/UserAgent.js.map +1 -1
- package/build/cjs/lib/driver/mDNSDiscovery.js +2 -0
- package/build/cjs/lib/driver/mDNSDiscovery.js.map +1 -1
- package/build/cjs/lib/log/Driver.js +6 -2
- package/build/cjs/lib/log/Driver.js.map +1 -1
- package/build/cjs/lib/log/Zniffer.js +6 -2
- package/build/cjs/lib/log/Zniffer.js.map +1 -1
- package/build/cjs/lib/node/DeviceClass.js +4 -0
- package/build/cjs/lib/node/DeviceClass.js.map +1 -1
- package/build/cjs/lib/node/Endpoint.js +9 -5
- package/build/cjs/lib/node/Endpoint.js.map +1 -1
- package/build/cjs/lib/node/HealthCheck.js +6 -0
- package/build/cjs/lib/node/HealthCheck.js.map +1 -1
- package/build/cjs/lib/node/MockNodeBehaviors.js +2 -0
- package/build/cjs/lib/node/MockNodeBehaviors.js.map +1 -1
- package/build/cjs/lib/node/MultiCCAPIWrapper.js +10 -8
- package/build/cjs/lib/node/MultiCCAPIWrapper.js.map +1 -1
- package/build/cjs/lib/node/Node.js +51 -46
- package/build/cjs/lib/node/Node.js.map +1 -1
- package/build/cjs/lib/node/NodeReadyMachine.js +3 -1
- package/build/cjs/lib/node/NodeReadyMachine.js.map +1 -1
- package/build/cjs/lib/node/NodeStatistics.js +5 -0
- package/build/cjs/lib/node/NodeStatistics.js.map +1 -1
- package/build/cjs/lib/node/NodeStatusMachine.js +5 -2
- package/build/cjs/lib/node/NodeStatusMachine.js.map +1 -1
- package/build/cjs/lib/node/VirtualEndpoint.js +8 -4
- package/build/cjs/lib/node/VirtualEndpoint.js.map +1 -1
- package/build/cjs/lib/node/VirtualNode.js +7 -2
- package/build/cjs/lib/node/VirtualNode.js.map +1 -1
- package/build/cjs/lib/node/mixins/00_Base.js +4 -0
- package/build/cjs/lib/node/mixins/00_Base.js.map +1 -1
- package/build/cjs/lib/node/mixins/01_NetworkRole.js +4 -0
- package/build/cjs/lib/node/mixins/01_NetworkRole.js.map +1 -1
- package/build/cjs/lib/node/mixins/05_Security.js +7 -3
- package/build/cjs/lib/node/mixins/05_Security.js.map +1 -1
- package/build/cjs/lib/node/mixins/10_Events.js +4 -0
- package/build/cjs/lib/node/mixins/10_Events.js.map +1 -1
- package/build/cjs/lib/node/mixins/20_Status.js +4 -0
- package/build/cjs/lib/node/mixins/20_Status.js.map +1 -1
- package/build/cjs/lib/node/mixins/30_Wakeup.js +4 -0
- package/build/cjs/lib/node/mixins/30_Wakeup.js.map +1 -1
- package/build/cjs/lib/node/mixins/40_Values.js +4 -0
- package/build/cjs/lib/node/mixins/40_Values.js.map +1 -1
- package/build/cjs/lib/node/mixins/50_Endpoints.js +4 -0
- package/build/cjs/lib/node/mixins/50_Endpoints.js.map +1 -1
- package/build/cjs/lib/node/mixins/60_ScheduledPoll.js +4 -0
- package/build/cjs/lib/node/mixins/60_ScheduledPoll.js.map +1 -1
- package/build/cjs/lib/node/mixins/70_FirmwareUpdate.js +8 -3
- package/build/cjs/lib/node/mixins/70_FirmwareUpdate.js.map +1 -1
- package/build/cjs/lib/node/mixins/index.js +4 -0
- package/build/cjs/lib/node/mixins/index.js.map +1 -1
- package/build/cjs/lib/node/mockCCBehaviors/ColorSwitch.js +2 -1
- package/build/cjs/lib/node/mockCCBehaviors/ColorSwitch.js.map +1 -1
- package/build/cjs/lib/node/mockCCBehaviors/Configuration.js +2 -1
- package/build/cjs/lib/node/mockCCBehaviors/Configuration.js.map +1 -1
- package/build/cjs/lib/node/mockCCBehaviors/ScheduleEntryLock.js +2 -1
- package/build/cjs/lib/node/mockCCBehaviors/ScheduleEntryLock.js.map +1 -1
- package/build/cjs/lib/node/mockCCBehaviors/ThermostatSetpoint.js +3 -2
- package/build/cjs/lib/node/mockCCBehaviors/ThermostatSetpoint.js.map +1 -1
- package/build/cjs/lib/node/mockCCBehaviors/UserCode.js +3 -2
- package/build/cjs/lib/node/mockCCBehaviors/UserCode.js.map +1 -1
- package/build/cjs/lib/node/utils.js +22 -2
- package/build/cjs/lib/node/utils.js.map +1 -1
- package/build/cjs/lib/telemetry/deviceConfig.js +2 -0
- package/build/cjs/lib/telemetry/deviceConfig.js.map +1 -1
- package/build/cjs/lib/telemetry/statistics.js +3 -0
- package/build/cjs/lib/telemetry/statistics.js.map +1 -1
- package/build/cjs/lib/zniffer/MPDU.js +57 -0
- package/build/cjs/lib/zniffer/MPDU.js.map +1 -1
- package/build/cjs/lib/zniffer/Zniffer.js +10 -3
- package/build/cjs/lib/zniffer/Zniffer.js.map +1 -1
- package/build/cjs/mockServer.js +14 -0
- package/build/cjs/mockServer.js.map +1 -1
- package/build/esm/lib/_version.d.ts +1 -1
- package/build/esm/lib/_version.js +1 -1
- package/package.json +12 -12
|
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
9
|
var __export = (target, all) => {
|
|
9
10
|
for (var name in all)
|
|
10
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -87,6 +88,7 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
|
|
|
87
88
|
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
88
89
|
return f;
|
|
89
90
|
}
|
|
91
|
+
__name(accept, "accept");
|
|
90
92
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
91
93
|
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
92
94
|
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
@@ -129,6 +131,9 @@ let ZWaveNode = (() => {
|
|
|
129
131
|
let _classThis;
|
|
130
132
|
let _classSuper = import_mixins.ZWaveNodeMixins;
|
|
131
133
|
var ZWaveNode2 = class extends _classSuper {
|
|
134
|
+
static {
|
|
135
|
+
__name(this, "ZWaveNode");
|
|
136
|
+
}
|
|
132
137
|
static {
|
|
133
138
|
_classThis = this;
|
|
134
139
|
}
|
|
@@ -386,7 +391,7 @@ let ZWaveNode = (() => {
|
|
|
386
391
|
if (hooks?.supervisionDelayedUpdates) {
|
|
387
392
|
api = api.withOptions({
|
|
388
393
|
requestStatusUpdates: true,
|
|
389
|
-
onUpdate: async (update) => {
|
|
394
|
+
onUpdate: /* @__PURE__ */ __name(async (update) => {
|
|
390
395
|
try {
|
|
391
396
|
if (update.status === import_core.SupervisionStatus.Success) {
|
|
392
397
|
await hooks.supervisionOnSuccess();
|
|
@@ -395,7 +400,7 @@ let ZWaveNode = (() => {
|
|
|
395
400
|
}
|
|
396
401
|
} catch {
|
|
397
402
|
}
|
|
398
|
-
}
|
|
403
|
+
}, "onUpdate")
|
|
399
404
|
});
|
|
400
405
|
}
|
|
401
406
|
if (typeof options.onProgress === "function") {
|
|
@@ -568,7 +573,7 @@ let ZWaveNode = (() => {
|
|
|
568
573
|
const preservedValues = [];
|
|
569
574
|
const preservedMetadata = [];
|
|
570
575
|
if (this.supportsCC(import_core.CommandClasses["User Code"]) && !this.driver.options.interview.queryAllUserCodes) {
|
|
571
|
-
const mustBackup = (v) => import_cc.UserCodeCCValues.userCode.is(v) || import_cc.UserCodeCCValues.userIdStatus.is(v) || import_cc.UserCodeCCValues.userCodeChecksum.is(v);
|
|
576
|
+
const mustBackup = /* @__PURE__ */ __name((v) => import_cc.UserCodeCCValues.userCode.is(v) || import_cc.UserCodeCCValues.userIdStatus.is(v) || import_cc.UserCodeCCValues.userCodeChecksum.is(v), "mustBackup");
|
|
572
577
|
const values = this.valueDB.getValues(import_core.CommandClasses["User Code"]).filter(mustBackup);
|
|
573
578
|
preservedValues.push(...values);
|
|
574
579
|
const meta = this.valueDB.getAllMetadata(import_core.CommandClasses["User Code"]).filter(mustBackup);
|
|
@@ -633,7 +638,7 @@ let ZWaveNode = (() => {
|
|
|
633
638
|
this.driver.controllerLog.interviewStart(this);
|
|
634
639
|
}
|
|
635
640
|
this._interviewAttempts++;
|
|
636
|
-
const tryInterviewStage = async (method) => {
|
|
641
|
+
const tryInterviewStage = /* @__PURE__ */ __name(async (method) => {
|
|
637
642
|
try {
|
|
638
643
|
await method();
|
|
639
644
|
return true;
|
|
@@ -643,7 +648,7 @@ let ZWaveNode = (() => {
|
|
|
643
648
|
}
|
|
644
649
|
throw e;
|
|
645
650
|
}
|
|
646
|
-
};
|
|
651
|
+
}, "tryInterviewStage");
|
|
647
652
|
if (this.interviewStage === import_Types2.InterviewStage.None) {
|
|
648
653
|
this.driver.controllerLog.logNode(this.id, `new node, doing a full interview...`);
|
|
649
654
|
this.emit("interview started", this);
|
|
@@ -840,7 +845,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
840
845
|
return true;
|
|
841
846
|
}
|
|
842
847
|
const securityManager2 = this.driver.getSecurityManager2(this.id);
|
|
843
|
-
const interviewEndpoint = async (endpoint, cc, force = false) => {
|
|
848
|
+
const interviewEndpoint = /* @__PURE__ */ __name(async (endpoint, cc, force = false) => {
|
|
844
849
|
let instance;
|
|
845
850
|
try {
|
|
846
851
|
if (force) {
|
|
@@ -868,7 +873,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
868
873
|
}
|
|
869
874
|
throw e;
|
|
870
875
|
}
|
|
871
|
-
};
|
|
876
|
+
}, "interviewEndpoint");
|
|
872
877
|
if (this.supportsCC(import_core.CommandClasses["Security 2"])) {
|
|
873
878
|
this.addCC(import_core.CommandClasses["Security 2"], { secure: true });
|
|
874
879
|
const securityClass = this.getHighestSecurityClass();
|
|
@@ -1026,23 +1031,23 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1026
1031
|
const possibleTests = [
|
|
1027
1032
|
{
|
|
1028
1033
|
ccId: import_core.CommandClasses["Z-Wave Plus Info"],
|
|
1029
|
-
test: () => endpoint.commandClasses["Z-Wave Plus Info"].get()
|
|
1034
|
+
test: /* @__PURE__ */ __name(() => endpoint.commandClasses["Z-Wave Plus Info"].get(), "test")
|
|
1030
1035
|
},
|
|
1031
1036
|
{
|
|
1032
1037
|
ccId: import_core.CommandClasses["Binary Switch"],
|
|
1033
|
-
test: () => endpoint.commandClasses["Binary Switch"].get()
|
|
1038
|
+
test: /* @__PURE__ */ __name(() => endpoint.commandClasses["Binary Switch"].get(), "test")
|
|
1034
1039
|
},
|
|
1035
1040
|
{
|
|
1036
1041
|
ccId: import_core.CommandClasses["Binary Sensor"],
|
|
1037
|
-
test: () => endpoint.commandClasses["Binary Sensor"].get()
|
|
1042
|
+
test: /* @__PURE__ */ __name(() => endpoint.commandClasses["Binary Sensor"].get(), "test")
|
|
1038
1043
|
},
|
|
1039
1044
|
{
|
|
1040
1045
|
ccId: import_core.CommandClasses["Multilevel Switch"],
|
|
1041
|
-
test: () => endpoint.commandClasses["Multilevel Switch"].get()
|
|
1046
|
+
test: /* @__PURE__ */ __name(() => endpoint.commandClasses["Multilevel Switch"].get(), "test")
|
|
1042
1047
|
},
|
|
1043
1048
|
{
|
|
1044
1049
|
ccId: import_core.CommandClasses["Multilevel Sensor"],
|
|
1045
|
-
test: () => endpoint.commandClasses["Multilevel Sensor"].get()
|
|
1050
|
+
test: /* @__PURE__ */ __name(() => endpoint.commandClasses["Multilevel Sensor"].get(), "test")
|
|
1046
1051
|
}
|
|
1047
1052
|
// TODO: add other tests if necessary
|
|
1048
1053
|
];
|
|
@@ -1546,7 +1551,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1546
1551
|
// Security CC is always secure
|
|
1547
1552
|
secure: true
|
|
1548
1553
|
});
|
|
1549
|
-
const isNonceReport = (t) => t.message.getNodeId() === this.id && (0, import_serialapi4.containsCC)(t.message) && t.message.command instanceof import_SecurityCC.SecurityCCNonceReport;
|
|
1554
|
+
const isNonceReport = /* @__PURE__ */ __name((t) => t.message.getNodeId() === this.id && (0, import_serialapi4.containsCC)(t.message) && t.message.command instanceof import_SecurityCC.SecurityCCNonceReport, "isNonceReport");
|
|
1550
1555
|
if (this.driver.hasPendingTransactions(isNonceReport)) {
|
|
1551
1556
|
this.driver.controllerLog.logNode(this.id, {
|
|
1552
1557
|
message: "in the process of replying to a NonceGet, won't send another NonceReport",
|
|
@@ -1602,7 +1607,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1602
1607
|
// Security 2 CC is always secure
|
|
1603
1608
|
secure: true
|
|
1604
1609
|
});
|
|
1605
|
-
const isNonceReport = (t) => t.message.getNodeId() === this.id && (0, import_serialapi4.containsCC)(t.message) && t.message.command instanceof import_Security2CC.Security2CCNonceReport;
|
|
1610
|
+
const isNonceReport = /* @__PURE__ */ __name((t) => t.message.getNodeId() === this.id && (0, import_serialapi4.containsCC)(t.message) && t.message.command instanceof import_Security2CC.Security2CCNonceReport, "isNonceReport");
|
|
1606
1611
|
if (this.driver.hasPendingTransactions(isNonceReport)) {
|
|
1607
1612
|
this.driver.controllerLog.logNode(this.id, {
|
|
1608
1613
|
message: "in the process of replying to a NonceGet, won't send another NonceReport",
|
|
@@ -1659,16 +1664,16 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1659
1664
|
} else {
|
|
1660
1665
|
this.lastCentralSceneNotificationSequenceNumber = command.sequenceNumber;
|
|
1661
1666
|
}
|
|
1662
|
-
const setSceneValue = (sceneNumber, key) => {
|
|
1667
|
+
const setSceneValue = /* @__PURE__ */ __name((sceneNumber, key) => {
|
|
1663
1668
|
const valueId = import_CentralSceneCC.CentralSceneCCValues.scene(sceneNumber).id;
|
|
1664
1669
|
this.valueDB.setValue(valueId, key, { stateful: false });
|
|
1665
|
-
};
|
|
1666
|
-
const forceKeyUp = () => {
|
|
1670
|
+
}, "setSceneValue");
|
|
1671
|
+
const forceKeyUp = /* @__PURE__ */ __name(() => {
|
|
1667
1672
|
this.centralSceneForcedKeyUp = true;
|
|
1668
1673
|
setSceneValue(this.centralSceneKeyHeldDownContext.sceneNumber, import_cc.CentralSceneKeys.KeyReleased);
|
|
1669
1674
|
clearTimeout(this.centralSceneKeyHeldDownContext.timeout);
|
|
1670
1675
|
this.centralSceneKeyHeldDownContext = void 0;
|
|
1671
|
-
};
|
|
1676
|
+
}, "forceKeyUp");
|
|
1672
1677
|
if (this.centralSceneKeyHeldDownContext && this.centralSceneKeyHeldDownContext.sceneNumber !== command.sceneNumber) {
|
|
1673
1678
|
forceKeyUp();
|
|
1674
1679
|
}
|
|
@@ -2540,10 +2545,10 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2540
2545
|
message: `[handleNotificationReport] notificationName: ${notificationName}`,
|
|
2541
2546
|
level: "silly"
|
|
2542
2547
|
});
|
|
2543
|
-
const setStateIdle = (prevValue) => {
|
|
2548
|
+
const setStateIdle = /* @__PURE__ */ __name((prevValue) => {
|
|
2544
2549
|
this.manuallyIdleNotificationValueInternal(notification, prevValue, command.endpointIndex);
|
|
2545
|
-
};
|
|
2546
|
-
const setUnknownStateIdle = (prevValue) => {
|
|
2550
|
+
}, "setStateIdle");
|
|
2551
|
+
const setUnknownStateIdle = /* @__PURE__ */ __name((prevValue) => {
|
|
2547
2552
|
const unknownNotificationVariableValueId = import_NotificationCC.NotificationCCValues.unknownNotificationVariable(command.notificationType, notificationName).endpoint(command.endpointIndex);
|
|
2548
2553
|
const currentValue = this.valueDB.getValue(unknownNotificationVariableValueId);
|
|
2549
2554
|
if (currentValue == void 0)
|
|
@@ -2551,7 +2556,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2551
2556
|
if (prevValue == void 0 || currentValue === prevValue) {
|
|
2552
2557
|
this.valueDB.setValue(unknownNotificationVariableValueId, 0);
|
|
2553
2558
|
}
|
|
2554
|
-
};
|
|
2559
|
+
}, "setUnknownStateIdle");
|
|
2555
2560
|
const value = command.notificationEvent;
|
|
2556
2561
|
if (value === 0) {
|
|
2557
2562
|
if ((0, import_shared.isUint8Array)(command.eventParameters) && command.eventParameters.length) {
|
|
@@ -2847,10 +2852,10 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2847
2852
|
const wasKeptAwake = this.keepAwake;
|
|
2848
2853
|
if (this.canSleep)
|
|
2849
2854
|
this.keepAwake = true;
|
|
2850
|
-
const result = (value) => {
|
|
2855
|
+
const result = /* @__PURE__ */ __name((value) => {
|
|
2851
2856
|
this.keepAwake = wasKeptAwake;
|
|
2852
2857
|
return value;
|
|
2853
|
-
};
|
|
2858
|
+
}, "result");
|
|
2854
2859
|
await api.startNodeTest(testNodeId, powerlevel, healthCheckTestFrameCount2);
|
|
2855
2860
|
const expectedDurationMs = Math.round(healthCheckTestFrameCount2 / 5 * 1e3);
|
|
2856
2861
|
const pollFrequencyMs = expectedDurationMs >= 6e4 ? 2e4 : 5e3;
|
|
@@ -2922,7 +2927,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2922
2927
|
}
|
|
2923
2928
|
async checkLifelineHealthInternal(rounds, onProgress) {
|
|
2924
2929
|
const start = Date.now();
|
|
2925
|
-
const computeRating = (result) => {
|
|
2930
|
+
const computeRating = /* @__PURE__ */ __name((result) => {
|
|
2926
2931
|
const failedPings = Math.max(result.failedPingsController ?? 0, result.failedPingsNode);
|
|
2927
2932
|
const numNeighbors = result.numNeighbors;
|
|
2928
2933
|
const minPowerlevel = result.minPowerlevel ?? import_cc.Powerlevel["-6 dBm"];
|
|
@@ -2950,10 +2955,10 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2950
2955
|
if (latency > 50)
|
|
2951
2956
|
return 9;
|
|
2952
2957
|
return 10;
|
|
2953
|
-
};
|
|
2958
|
+
}, "computeRating");
|
|
2954
2959
|
this.driver.controllerLog.logNode(this.id, `Starting lifeline health check (${rounds} round${rounds !== 1 ? "s" : ""})...`);
|
|
2955
2960
|
const results = [];
|
|
2956
|
-
const aborted = () => {
|
|
2961
|
+
const aborted = /* @__PURE__ */ __name(() => {
|
|
2957
2962
|
this.driver.controllerLog.logNode(this.id, `Lifeline health check aborted`);
|
|
2958
2963
|
if (results.length === 0) {
|
|
2959
2964
|
return {
|
|
@@ -2966,7 +2971,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2966
2971
|
results
|
|
2967
2972
|
};
|
|
2968
2973
|
}
|
|
2969
|
-
};
|
|
2974
|
+
}, "aborted");
|
|
2970
2975
|
if (this.canSleep && this.status !== import_Types2.NodeStatus.Awake) {
|
|
2971
2976
|
this.driver.controllerLog.logNode(this.id, `waiting for node to wake up...`);
|
|
2972
2977
|
await Promise.race([
|
|
@@ -2996,9 +3001,9 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2996
3001
|
// Avoid using explorer frames, because they can create a ton of delay
|
|
2997
3002
|
transmitOptions: import_core.TransmitOptions.ACK | import_core.TransmitOptions.AutoRoute,
|
|
2998
3003
|
// And remember the transmit report, so we can evaluate it
|
|
2999
|
-
onTXReport: (report) => {
|
|
3004
|
+
onTXReport: /* @__PURE__ */ __name((report) => {
|
|
3000
3005
|
txReport = report;
|
|
3001
|
-
}
|
|
3006
|
+
}, "onTXReport")
|
|
3002
3007
|
});
|
|
3003
3008
|
for (let i = 1; i <= import_HealthCheck.healthCheckTestFrameCount; i++) {
|
|
3004
3009
|
if (this._healthCheckAborted)
|
|
@@ -3056,7 +3061,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
3056
3061
|
};
|
|
3057
3062
|
if (this.supportsCC(import_core.CommandClasses.Powerlevel)) {
|
|
3058
3063
|
let failedPingsController = 0;
|
|
3059
|
-
const executor = async (powerlevel) => {
|
|
3064
|
+
const executor = /* @__PURE__ */ __name(async (powerlevel) => {
|
|
3060
3065
|
if (this._healthCheckAborted)
|
|
3061
3066
|
return void 0;
|
|
3062
3067
|
this.driver.controllerLog.logNode(this.id, `Sending ${import_HealthCheck.healthCheckTestFrameCount} pings to controller at ${(0, import_shared.getEnumMemberName)(import_cc.Powerlevel, powerlevel)}...`);
|
|
@@ -3065,7 +3070,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
3065
3070
|
this.driver.controllerLog.logNode(this.id, `At ${(0, import_shared.getEnumMemberName)(import_cc.Powerlevel, powerlevel)}, ${result}/${import_HealthCheck.healthCheckTestFrameCount} pings were acknowledged...`);
|
|
3066
3071
|
await (0, import_async.wait)(1e3);
|
|
3067
3072
|
return failedPingsController === 0;
|
|
3068
|
-
};
|
|
3073
|
+
}, "executor");
|
|
3069
3074
|
try {
|
|
3070
3075
|
const powerlevel = await (0, import_shared.discreteLinearSearch)(
|
|
3071
3076
|
import_cc.Powerlevel["Normal Power"],
|
|
@@ -3139,7 +3144,7 @@ ${(0, import_HealthCheck.formatLifelineHealthCheckSummary)(summary)}`);
|
|
|
3139
3144
|
}
|
|
3140
3145
|
const healthCheckTestFrameCount2 = 10;
|
|
3141
3146
|
const start = Date.now();
|
|
3142
|
-
const computeRating = (result) => {
|
|
3147
|
+
const computeRating = /* @__PURE__ */ __name((result) => {
|
|
3143
3148
|
const failedPings = Math.max(result.failedPingsToSource ?? 0, result.failedPingsToTarget ?? 0);
|
|
3144
3149
|
const numNeighbors = result.numNeighbors;
|
|
3145
3150
|
const minPowerlevel = Math.max(result.minPowerlevelSource ?? import_cc.Powerlevel["-6 dBm"], result.minPowerlevelTarget ?? import_cc.Powerlevel["-6 dBm"]);
|
|
@@ -3157,10 +3162,10 @@ ${(0, import_HealthCheck.formatLifelineHealthCheckSummary)(summary)}`);
|
|
|
3157
3162
|
if (numNeighbors <= 2)
|
|
3158
3163
|
return 8;
|
|
3159
3164
|
return 10;
|
|
3160
|
-
};
|
|
3165
|
+
}, "computeRating");
|
|
3161
3166
|
this.driver.controllerLog.logNode(this.id, `Starting route health check to node ${targetNodeId} (${rounds} round${rounds !== 1 ? "s" : ""})...`);
|
|
3162
3167
|
const results = [];
|
|
3163
|
-
const aborted = () => {
|
|
3168
|
+
const aborted = /* @__PURE__ */ __name(() => {
|
|
3164
3169
|
this.driver.controllerLog.logNode(this.id, `Route health check to node ${targetNodeId} aborted`);
|
|
3165
3170
|
if (results.length === 0) {
|
|
3166
3171
|
return {
|
|
@@ -3173,7 +3178,7 @@ ${(0, import_HealthCheck.formatLifelineHealthCheckSummary)(summary)}`);
|
|
|
3173
3178
|
results
|
|
3174
3179
|
};
|
|
3175
3180
|
}
|
|
3176
|
-
};
|
|
3181
|
+
}, "aborted");
|
|
3177
3182
|
if (this.canSleep && this.status !== import_Types2.NodeStatus.Awake) {
|
|
3178
3183
|
this.driver.controllerLog.logNode(this.id, `waiting for node to wake up...`);
|
|
3179
3184
|
await Promise.race([
|
|
@@ -3192,7 +3197,7 @@ ${(0, import_HealthCheck.formatLifelineHealthCheckSummary)(summary)}`);
|
|
|
3192
3197
|
let minPowerlevelSource;
|
|
3193
3198
|
let failedPingsToTarget;
|
|
3194
3199
|
let minPowerlevelTarget;
|
|
3195
|
-
const executor = (node, otherNode2) => async (powerlevel) => {
|
|
3200
|
+
const executor = /* @__PURE__ */ __name((node, otherNode2) => async (powerlevel) => {
|
|
3196
3201
|
if (this._healthCheckAborted)
|
|
3197
3202
|
return void 0;
|
|
3198
3203
|
this.driver.controllerLog.logNode(node.id, `Sending ${healthCheckTestFrameCount2} pings to node ${otherNode2.id} at ${(0, import_shared.getEnumMemberName)(import_cc.Powerlevel, powerlevel)}...`);
|
|
@@ -3201,7 +3206,7 @@ ${(0, import_HealthCheck.formatLifelineHealthCheckSummary)(summary)}`);
|
|
|
3201
3206
|
this.driver.controllerLog.logNode(node.id, `At ${(0, import_shared.getEnumMemberName)(import_cc.Powerlevel, powerlevel)}, ${result}/${healthCheckTestFrameCount2} pings were acknowledged by node ${otherNode2.id}...`);
|
|
3202
3207
|
await (0, import_async.wait)(1e3);
|
|
3203
3208
|
return failedPings === 0;
|
|
3204
|
-
};
|
|
3209
|
+
}, "executor");
|
|
3205
3210
|
if (this.supportsCC(import_core.CommandClasses.Powerlevel)) {
|
|
3206
3211
|
try {
|
|
3207
3212
|
const powerlevel = await (0, import_shared.discreteLinearSearch)(
|
|
@@ -3349,17 +3354,17 @@ ${(0, import_HealthCheck.formatRouteHealthCheckSummary)(this.id, otherNode.id, s
|
|
|
3349
3354
|
average: Number.NEGATIVE_INFINITY
|
|
3350
3355
|
} : void 0
|
|
3351
3356
|
};
|
|
3352
|
-
const aborted = () => {
|
|
3357
|
+
const aborted = /* @__PURE__ */ __name(() => {
|
|
3353
3358
|
this.driver.controllerLog.logNode(this.id, `Link reliability check aborted`);
|
|
3354
3359
|
return result;
|
|
3355
|
-
};
|
|
3360
|
+
}, "aborted");
|
|
3356
3361
|
let lastProgressReport = 0;
|
|
3357
|
-
const reportProgress = () => {
|
|
3362
|
+
const reportProgress = /* @__PURE__ */ __name(() => {
|
|
3358
3363
|
if (Date.now() - lastProgressReport >= 250) {
|
|
3359
3364
|
options.onProgress?.((0, import_shared.cloneDeep)(result));
|
|
3360
3365
|
lastProgressReport = Date.now();
|
|
3361
3366
|
}
|
|
3362
|
-
};
|
|
3367
|
+
}, "reportProgress");
|
|
3363
3368
|
if (this.canSleep && this.status !== import_Types2.NodeStatus.Awake) {
|
|
3364
3369
|
this.driver.controllerLog.logNode(this.id, `waiting for node to wake up...`);
|
|
3365
3370
|
await Promise.race([
|
|
@@ -3378,9 +3383,9 @@ ${(0, import_HealthCheck.formatRouteHealthCheckSummary)(this.id, otherNode.id, s
|
|
|
3378
3383
|
// Do not wait for SOS NonceReports, as it slows down the test
|
|
3379
3384
|
s2VerifyDelivery: false,
|
|
3380
3385
|
// And remember the transmit report, so we can evaluate it
|
|
3381
|
-
onTXReport: (report) => {
|
|
3386
|
+
onTXReport: /* @__PURE__ */ __name((report) => {
|
|
3382
3387
|
txReport = report;
|
|
3383
|
-
}
|
|
3388
|
+
}, "onTXReport")
|
|
3384
3389
|
});
|
|
3385
3390
|
let lastStart;
|
|
3386
3391
|
for (let round = 1; round <= (options.rounds ?? Number.POSITIVE_INFINITY); round++) {
|
|
@@ -3725,7 +3730,7 @@ ${(0, import_HealthCheck.formatRouteHealthCheckSummary)(this.id, otherNode.id, s
|
|
|
3725
3730
|
ret.securityClasses[(0, import_shared.getEnumMemberName)(import_core.SecurityClass, secClass)] = this.hasSecurityClass(secClass) ?? "unknown";
|
|
3726
3731
|
}
|
|
3727
3732
|
const allValueIds = nodeUtils.getDefinedValueIDsInternal(this.driver, this, true);
|
|
3728
|
-
const collectValues = (endpointIndex, getCollection) => {
|
|
3733
|
+
const collectValues = /* @__PURE__ */ __name((endpointIndex, getCollection) => {
|
|
3729
3734
|
for (const valueId of allValueIds) {
|
|
3730
3735
|
if ((valueId.endpoint ?? 0) !== endpointIndex)
|
|
3731
3736
|
continue;
|
|
@@ -3752,7 +3757,7 @@ ${(0, import_HealthCheck.formatRouteHealthCheckSummary)(this.id, otherNode.id, s
|
|
|
3752
3757
|
}
|
|
3753
3758
|
getCollection(valueId.commandClass)?.push(valueDump);
|
|
3754
3759
|
}
|
|
3755
|
-
};
|
|
3760
|
+
}, "collectValues");
|
|
3756
3761
|
collectValues(0, (ccId) => ret.commandClasses[(0, import_core.getCCName)(ccId)]?.values);
|
|
3757
3762
|
for (const endpoint of this.getAllEndpoints()) {
|
|
3758
3763
|
if (endpoint.index === 0)
|