zwave-js 12.12.5 → 12.13.1
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/lib/node/Node.d.ts +20 -1
- package/build/lib/node/Node.d.ts.map +1 -1
- package/build/lib/node/Node.js +202 -36
- package/build/lib/node/Node.js.map +1 -1
- package/build/lib/node/_Types.d.ts +30 -0
- package/build/lib/node/_Types.d.ts.map +1 -1
- package/build/lib/node/_Types.js +5 -1
- package/build/lib/node/_Types.js.map +1 -1
- package/package.json +9 -9
package/build/lib/node/Node.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { DeviceClass } from "./DeviceClass";
|
|
|
10
10
|
import { type NodeDump } from "./Dump";
|
|
11
11
|
import { Endpoint } from "./Endpoint";
|
|
12
12
|
import { type NodeStatistics, NodeStatisticsHost } from "./NodeStatistics";
|
|
13
|
-
import type
|
|
13
|
+
import { type DateAndTime, type LifelineHealthCheckResult, type LifelineHealthCheckSummary, type LinkReliabilityCheckOptions, type LinkReliabilityCheckResult, type RefreshInfoOptions, type RouteHealthCheckResult, type RouteHealthCheckSummary, type ZWaveNodeEventCallbacks } from "./_Types";
|
|
14
14
|
import { InterviewStage, NodeStatus } from "./_Types";
|
|
15
15
|
export interface ZWaveNode extends TypedEventEmitter<ZWaveNodeEventCallbacks & StatisticsEventCallbacksWithSelf<ZWaveNode, NodeStatistics>>, NodeStatisticsHost {
|
|
16
16
|
}
|
|
@@ -438,6 +438,25 @@ export declare class ZWaveNode extends Endpoint implements SecurityClassOwner, I
|
|
|
438
438
|
*/
|
|
439
439
|
checkRouteHealth(targetNodeId: number, rounds?: number, onProgress?: (round: number, totalRounds: number, lastRating: number, lastResult: RouteHealthCheckResult) => void): Promise<RouteHealthCheckSummary>;
|
|
440
440
|
private checkRouteHealthInternal;
|
|
441
|
+
private _linkReliabilityCheckInProgress;
|
|
442
|
+
/**
|
|
443
|
+
* Returns whether a link reliability check is currently in progress for this node
|
|
444
|
+
*/
|
|
445
|
+
isLinkReliabilityCheckInProgress(): boolean;
|
|
446
|
+
private _linkReliabilityCheckAborted;
|
|
447
|
+
private _abortLinkReliabilityCheckPromise;
|
|
448
|
+
/**
|
|
449
|
+
* Aborts an ongoing link reliability check if one is currently in progress.
|
|
450
|
+
*
|
|
451
|
+
* **Note:** The link reliability check may take a few seconds to actually be aborted.
|
|
452
|
+
* When it is, the promise returned by {@link checkLinkReliability} will be resolved with the results obtained so far.
|
|
453
|
+
*/
|
|
454
|
+
abortLinkReliabilityCheck(): void;
|
|
455
|
+
/**
|
|
456
|
+
* Tests the reliability of the link between the controller and this node and returns the results.
|
|
457
|
+
*/
|
|
458
|
+
checkLinkReliability(options: LinkReliabilityCheckOptions): Promise<LinkReliabilityCheckResult>;
|
|
459
|
+
private checkLinkReliabilityBasicSetOnOff;
|
|
441
460
|
/**
|
|
442
461
|
* Sets the current date, time and timezone (or a subset of those) on the node using one or more of the respective CCs.
|
|
443
462
|
* Returns whether the operation was successful.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../src/lib/node/Node.ts"],"names":[],"mappings":";AAAA,OAAO,EAWN,KAAK,0BAA0B,EAI/B,KAAK,oBAAoB,EAezB,UAAU,EAIV,KAAK,kBAAkB,EAQvB,iBAAiB,EACjB,iBAAiB,EAOjB,MAAM,cAAc,CAAC;AAiGtB,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,KAAK,YAAY,EAIjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGN,cAAc,EACd,KAAK,QAAQ,EACb,QAAQ,EAER,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,aAAa,EAIlB,QAAQ,EACR,KAAK,iBAAiB,EACtB,eAAe,EACf,SAAS,EAGT,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EAKvB,KAAK,iBAAiB,EA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A4B,CAAkB;IACtD,OAAO,CAAC,iCAAiC,CAE5B;IAEb;;;;;OAKG;IACI,yBAAyB,IAAI,IAAI;IAKxC;;OAEG;IACU,oBAAoB,CAChC,OAAO,EAAE,2BAA2B,GAClC,OAAO,CAAC,0BAA0B,CAAC;YAgCxB,iCAAiC;IAyO/C;;;OAGG;IACU,cAAc,CAAC,GAAG,GAAE,IAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAsIrE;;OAEG;IACU,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAmItC,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAU1D;;;OAGG;IACI,sBAAsB,IAAI,aAAa,CAAC,OAAO,CAAC;IAoBvD,uEAAuE;IAChE,UAAU,IAAI,QAAQ;CAoJ7B"}
|
package/build/lib/node/Node.js
CHANGED
|
@@ -89,6 +89,7 @@ const NodeReadyMachine_1 = require("./NodeReadyMachine");
|
|
|
89
89
|
const NodeStatistics_1 = require("./NodeStatistics");
|
|
90
90
|
const NodeStatusMachine_1 = require("./NodeStatusMachine");
|
|
91
91
|
const _Types_1 = require("./_Types");
|
|
92
|
+
const _Types_2 = require("./_Types");
|
|
92
93
|
const nodeUtils = __importStar(require("./utils"));
|
|
93
94
|
const MAX_ASSOCIATIONS = 1;
|
|
94
95
|
/**
|
|
@@ -272,30 +273,30 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
272
273
|
this.emit(eventName, this, outArg);
|
|
273
274
|
}
|
|
274
275
|
statusMachine;
|
|
275
|
-
_status =
|
|
276
|
+
_status = _Types_2.NodeStatus.Unknown;
|
|
276
277
|
onStatusChange(newStatus) {
|
|
277
278
|
// Ignore duplicate events
|
|
278
279
|
if (newStatus === this._status)
|
|
279
280
|
return;
|
|
280
281
|
const oldStatus = this._status;
|
|
281
282
|
this._status = newStatus;
|
|
282
|
-
if (this._status ===
|
|
283
|
+
if (this._status === _Types_2.NodeStatus.Asleep) {
|
|
283
284
|
this.emit("sleep", this, oldStatus);
|
|
284
285
|
}
|
|
285
|
-
else if (this._status ===
|
|
286
|
+
else if (this._status === _Types_2.NodeStatus.Awake) {
|
|
286
287
|
this.emit("wake up", this, oldStatus);
|
|
287
288
|
}
|
|
288
|
-
else if (this._status ===
|
|
289
|
+
else if (this._status === _Types_2.NodeStatus.Dead) {
|
|
289
290
|
this.emit("dead", this, oldStatus);
|
|
290
291
|
}
|
|
291
|
-
else if (this._status ===
|
|
292
|
+
else if (this._status === _Types_2.NodeStatus.Alive) {
|
|
292
293
|
this.emit("alive", this, oldStatus);
|
|
293
294
|
}
|
|
294
295
|
// To be marked ready, a node must be known to be not dead.
|
|
295
296
|
// This means that listening nodes must have communicated with us and
|
|
296
297
|
// sleeping nodes are assumed to be ready
|
|
297
|
-
this.readyMachine.send(this._status !==
|
|
298
|
-
&& this._status !==
|
|
298
|
+
this.readyMachine.send(this._status !== _Types_2.NodeStatus.Unknown
|
|
299
|
+
&& this._status !== _Types_2.NodeStatus.Dead
|
|
299
300
|
? "NOT_DEAD"
|
|
300
301
|
: "MAYBE_DEAD");
|
|
301
302
|
}
|
|
@@ -338,7 +339,7 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
338
339
|
if (!this.canSleep || !this.supportsCC(core_1.CommandClasses["Wake Up"])) {
|
|
339
340
|
throw new core_1.ZWaveError(`Node ${this.id} does not support wakeup!`, core_1.ZWaveErrorCodes.CC_NotSupported);
|
|
340
341
|
}
|
|
341
|
-
else if (this._status ===
|
|
342
|
+
else if (this._status === _Types_2.NodeStatus.Awake) {
|
|
342
343
|
return Promise.resolve();
|
|
343
344
|
}
|
|
344
345
|
return new Promise((resolve) => {
|
|
@@ -1085,7 +1086,7 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
1085
1086
|
*/
|
|
1086
1087
|
get interviewStage() {
|
|
1087
1088
|
return (this.driver.cacheGet(NetworkCache_1.cacheKeys.node(this.id).interviewStage)
|
|
1088
|
-
??
|
|
1089
|
+
?? _Types_2.InterviewStage.None);
|
|
1089
1090
|
}
|
|
1090
1091
|
set interviewStage(value) {
|
|
1091
1092
|
this.driver.cacheSet(NetworkCache_1.cacheKeys.node(this.id).interviewStage, value);
|
|
@@ -1172,7 +1173,7 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
1172
1173
|
if (resetSecurityClasses)
|
|
1173
1174
|
this.securityClasses.clear();
|
|
1174
1175
|
this._interviewAttempts = 0;
|
|
1175
|
-
this.interviewStage =
|
|
1176
|
+
this.interviewStage = _Types_2.InterviewStage.None;
|
|
1176
1177
|
this._ready = false;
|
|
1177
1178
|
this.deviceClass = undefined;
|
|
1178
1179
|
this.isListening = undefined;
|
|
@@ -1229,7 +1230,7 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
1229
1230
|
* for a specific node, use `node.refreshInfo()` instead
|
|
1230
1231
|
*/
|
|
1231
1232
|
async interviewInternal() {
|
|
1232
|
-
if (this.interviewStage ===
|
|
1233
|
+
if (this.interviewStage === _Types_2.InterviewStage.Complete) {
|
|
1233
1234
|
this.driver.controllerLog.logNode(this.id, `skipping interview because it is already completed`);
|
|
1234
1235
|
return true;
|
|
1235
1236
|
}
|
|
@@ -1255,7 +1256,7 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
1255
1256
|
// The interview is done in several stages. At each point, the interview process might be aborted
|
|
1256
1257
|
// due to a stage failing. The reached stage is saved, so we can continue it later without
|
|
1257
1258
|
// repeating stages unnecessarily
|
|
1258
|
-
if (this.interviewStage ===
|
|
1259
|
+
if (this.interviewStage === _Types_2.InterviewStage.None) {
|
|
1259
1260
|
// do a full interview starting with the protocol info
|
|
1260
1261
|
this.driver.controllerLog.logNode(this.id, `new node, doing a full interview...`);
|
|
1261
1262
|
this.emit("interview started", this);
|
|
@@ -1263,24 +1264,24 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
1263
1264
|
}
|
|
1264
1265
|
if (!this.isControllerNode) {
|
|
1265
1266
|
if ((this.isListening || this.isFrequentListening)
|
|
1266
|
-
&& this.status !==
|
|
1267
|
+
&& this.status !== _Types_2.NodeStatus.Alive) {
|
|
1267
1268
|
// Ping non-sleeping nodes to determine their status
|
|
1268
1269
|
if (!await this.ping()) {
|
|
1269
1270
|
// Not alive, abort the interview
|
|
1270
1271
|
return false;
|
|
1271
1272
|
}
|
|
1272
1273
|
}
|
|
1273
|
-
if (this.interviewStage ===
|
|
1274
|
+
if (this.interviewStage === _Types_2.InterviewStage.ProtocolInfo) {
|
|
1274
1275
|
if (!(await tryInterviewStage(() => this.interviewNodeInfo()))) {
|
|
1275
1276
|
return false;
|
|
1276
1277
|
}
|
|
1277
1278
|
}
|
|
1278
1279
|
// At this point the basic interview of new nodes is done. Start here when re-interviewing known nodes
|
|
1279
1280
|
// to get updated information about command classes
|
|
1280
|
-
if (this.interviewStage ===
|
|
1281
|
+
if (this.interviewStage === _Types_2.InterviewStage.NodeInfo) {
|
|
1281
1282
|
// Only advance the interview if it was completed, otherwise abort
|
|
1282
1283
|
if (await this.interviewCCs()) {
|
|
1283
|
-
this.setInterviewStage(
|
|
1284
|
+
this.setInterviewStage(_Types_2.InterviewStage.CommandClasses);
|
|
1284
1285
|
}
|
|
1285
1286
|
else {
|
|
1286
1287
|
return false;
|
|
@@ -1288,15 +1289,15 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
1288
1289
|
}
|
|
1289
1290
|
}
|
|
1290
1291
|
if ((this.isControllerNode
|
|
1291
|
-
&& this.interviewStage ===
|
|
1292
|
+
&& this.interviewStage === _Types_2.InterviewStage.ProtocolInfo)
|
|
1292
1293
|
|| (!this.isControllerNode
|
|
1293
|
-
&& this.interviewStage ===
|
|
1294
|
+
&& this.interviewStage === _Types_2.InterviewStage.CommandClasses)) {
|
|
1294
1295
|
// Load a config file for this node if it exists and overwrite the previously reported information
|
|
1295
1296
|
await this.overwriteConfig();
|
|
1296
1297
|
}
|
|
1297
1298
|
// Remember the state of the device config that is used for this node
|
|
1298
1299
|
this.deviceConfigHash = this._deviceConfig?.getHash();
|
|
1299
|
-
this.setInterviewStage(
|
|
1300
|
+
this.setInterviewStage(_Types_2.InterviewStage.Complete);
|
|
1300
1301
|
this.readyMachine.send("INTERVIEW_DONE");
|
|
1301
1302
|
// Tell listeners that the interview is completed
|
|
1302
1303
|
// The driver will then send this node to sleep
|
|
@@ -1306,7 +1307,7 @@ let ZWaveNode = class ZWaveNode extends Endpoint_1.Endpoint {
|
|
|
1306
1307
|
/** Updates this node's interview stage and saves to cache when appropriate */
|
|
1307
1308
|
setInterviewStage(completedStage) {
|
|
1308
1309
|
this.interviewStage = completedStage;
|
|
1309
|
-
this.emit("interview stage completed", this, (0, shared_1.getEnumMemberName)(
|
|
1310
|
+
this.emit("interview stage completed", this, (0, shared_1.getEnumMemberName)(_Types_2.InterviewStage, completedStage));
|
|
1310
1311
|
this.driver.controllerLog.interviewStage(this);
|
|
1311
1312
|
}
|
|
1312
1313
|
/** Step #1 of the node interview */
|
|
@@ -1351,16 +1352,16 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1351
1352
|
});
|
|
1352
1353
|
// Assume that sleeping nodes start asleep (unless we know it is awake)
|
|
1353
1354
|
if (this.canSleep) {
|
|
1354
|
-
if (this.status ===
|
|
1355
|
+
if (this.status === _Types_2.NodeStatus.Alive) {
|
|
1355
1356
|
// If it was just included and is currently communicating with us,
|
|
1356
1357
|
// then we didn't know yet that it can sleep. So we need to switch from alive/dead to awake/asleep
|
|
1357
1358
|
this.markAsAwake();
|
|
1358
1359
|
}
|
|
1359
|
-
else if (this.status !==
|
|
1360
|
+
else if (this.status !== _Types_2.NodeStatus.Awake) {
|
|
1360
1361
|
this.markAsAsleep();
|
|
1361
1362
|
}
|
|
1362
1363
|
}
|
|
1363
|
-
this.setInterviewStage(
|
|
1364
|
+
this.setInterviewStage(_Types_2.InterviewStage.ProtocolInfo);
|
|
1364
1365
|
}
|
|
1365
1366
|
/** Node interview: pings the node to see if it responds */
|
|
1366
1367
|
async ping() {
|
|
@@ -1421,7 +1422,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1421
1422
|
if ((0, core_1.isZWaveError)(e)) {
|
|
1422
1423
|
if (attempts === 1
|
|
1423
1424
|
&& this.canSleep
|
|
1424
|
-
&& this.status !==
|
|
1425
|
+
&& this.status !== _Types_2.NodeStatus.Asleep
|
|
1425
1426
|
&& e.code === core_1.ZWaveErrorCodes.Controller_CallbackNOK) {
|
|
1426
1427
|
this.driver.controllerLog.logNode(this.id, `Querying the node info failed, the node is probably asleep. Retrying after wakeup...`, "error");
|
|
1427
1428
|
// We assumed the node to be awake, but it is not.
|
|
@@ -1437,7 +1438,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1437
1438
|
}
|
|
1438
1439
|
}
|
|
1439
1440
|
}
|
|
1440
|
-
this.setInterviewStage(
|
|
1441
|
+
this.setInterviewStage(_Types_2.InterviewStage.NodeInfo);
|
|
1441
1442
|
}
|
|
1442
1443
|
async requestNodeInfo() {
|
|
1443
1444
|
const resp = await this.driver.sendMessage(new RequestNodeInfoMessages_1.RequestNodeInfoRequest(this.driver, { nodeId: this.id }));
|
|
@@ -1955,7 +1956,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1955
1956
|
* Handles the receipt of a NIF / NodeUpdatePayload
|
|
1956
1957
|
*/
|
|
1957
1958
|
updateNodeInfo(nodeInfo) {
|
|
1958
|
-
if (this.interviewStage <
|
|
1959
|
+
if (this.interviewStage < _Types_2.InterviewStage.NodeInfo) {
|
|
1959
1960
|
for (const cc of nodeInfo.supportedCCs) {
|
|
1960
1961
|
if (cc === core_1.CommandClasses.Basic) {
|
|
1961
1962
|
// Basic CC MUST not be in the NIF and we have special rules to determine support
|
|
@@ -1972,7 +1973,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
1972
1973
|
// This is not the handler for wakeup notifications, but some legacy devices send this
|
|
1973
1974
|
// message whenever there's an update and want to be polled.
|
|
1974
1975
|
// We do this unless we know for certain that the device sends unsolicited reports for its actuator or sensor CCs
|
|
1975
|
-
if (this.interviewStage ===
|
|
1976
|
+
if (this.interviewStage === _Types_2.InterviewStage.Complete
|
|
1976
1977
|
&& !this.supportsCC(core_1.CommandClasses["Z-Wave Plus Info"])
|
|
1977
1978
|
&& (!this.valueDB.getValue(AssociationCC_1.AssociationCCValues.hasLifeline.id)
|
|
1978
1979
|
|| !cc_1.utils.doesAnyLifelineSendActuatorOrSensorReports(this.driver, this))) {
|
|
@@ -2050,7 +2051,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2050
2051
|
*/
|
|
2051
2052
|
async autoRefreshValues() {
|
|
2052
2053
|
// Do not attempt to communicate with dead nodes automatically
|
|
2053
|
-
if (this.status ===
|
|
2054
|
+
if (this.status === _Types_2.NodeStatus.Dead)
|
|
2054
2055
|
return;
|
|
2055
2056
|
for (const endpoint of this.getAllEndpoints()) {
|
|
2056
2057
|
for (const cc of endpoint
|
|
@@ -2172,7 +2173,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
2172
2173
|
}
|
|
2173
2174
|
}
|
|
2174
2175
|
}
|
|
2175
|
-
this.setInterviewStage(
|
|
2176
|
+
this.setInterviewStage(_Types_2.InterviewStage.OverwriteConfig);
|
|
2176
2177
|
}
|
|
2177
2178
|
/**
|
|
2178
2179
|
* @internal
|
|
@@ -4578,7 +4579,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
4578
4579
|
// Restore the device config
|
|
4579
4580
|
await this.loadDeviceConfig();
|
|
4580
4581
|
// Mark already-interviewed nodes as potentially ready
|
|
4581
|
-
if (this.interviewStage ===
|
|
4582
|
+
if (this.interviewStage === _Types_2.InterviewStage.Complete) {
|
|
4582
4583
|
this.readyMachine.send("RESTART_FROM_CACHE");
|
|
4583
4584
|
}
|
|
4584
4585
|
}
|
|
@@ -4600,8 +4601,8 @@ protocol version: ${this.protocolVersion}`;
|
|
|
4600
4601
|
return false;
|
|
4601
4602
|
this.isSendingNoMoreInformation = true;
|
|
4602
4603
|
let msgSent = false;
|
|
4603
|
-
if (this.status ===
|
|
4604
|
-
&& this.interviewStage ===
|
|
4604
|
+
if (this.status === _Types_2.NodeStatus.Awake
|
|
4605
|
+
&& this.interviewStage === _Types_2.InterviewStage.Complete) {
|
|
4605
4606
|
this.driver.controllerLog.logNode(this.id, {
|
|
4606
4607
|
message: "Sending node back to sleep...",
|
|
4607
4608
|
direction: "outbound",
|
|
@@ -4778,7 +4779,7 @@ protocol version: ${this.protocolVersion}`;
|
|
|
4778
4779
|
};
|
|
4779
4780
|
}
|
|
4780
4781
|
};
|
|
4781
|
-
if (this.canSleep && this.status !==
|
|
4782
|
+
if (this.canSleep && this.status !== _Types_2.NodeStatus.Awake) {
|
|
4782
4783
|
// Wait for node to wake up to avoid incorrectly long delays in the first health check round
|
|
4783
4784
|
this.driver.controllerLog.logNode(this.id, `waiting for node to wake up...`);
|
|
4784
4785
|
await Promise.race([
|
|
@@ -5015,7 +5016,7 @@ ${(0, HealthCheck_1.formatLifelineHealthCheckSummary)(summary)}`);
|
|
|
5015
5016
|
};
|
|
5016
5017
|
}
|
|
5017
5018
|
};
|
|
5018
|
-
if (this.canSleep && this.status !==
|
|
5019
|
+
if (this.canSleep && this.status !== _Types_2.NodeStatus.Awake) {
|
|
5019
5020
|
// Wait for node to wake up to avoid incorrectly long delays in the first health check round
|
|
5020
5021
|
this.driver.controllerLog.logNode(this.id, `waiting for node to wake up...`);
|
|
5021
5022
|
await Promise.race([
|
|
@@ -5131,6 +5132,171 @@ ${(0, HealthCheck_1.formatLifelineHealthCheckSummary)(summary)}`);
|
|
|
5131
5132
|
${(0, HealthCheck_1.formatRouteHealthCheckSummary)(this.id, otherNode.id, summary)}`);
|
|
5132
5133
|
return summary;
|
|
5133
5134
|
}
|
|
5135
|
+
_linkReliabilityCheckInProgress = false;
|
|
5136
|
+
/**
|
|
5137
|
+
* Returns whether a link reliability check is currently in progress for this node
|
|
5138
|
+
*/
|
|
5139
|
+
isLinkReliabilityCheckInProgress() {
|
|
5140
|
+
return this._linkReliabilityCheckInProgress;
|
|
5141
|
+
}
|
|
5142
|
+
_linkReliabilityCheckAborted = false;
|
|
5143
|
+
_abortLinkReliabilityCheckPromise;
|
|
5144
|
+
/**
|
|
5145
|
+
* Aborts an ongoing link reliability check if one is currently in progress.
|
|
5146
|
+
*
|
|
5147
|
+
* **Note:** The link reliability check may take a few seconds to actually be aborted.
|
|
5148
|
+
* When it is, the promise returned by {@link checkLinkReliability} will be resolved with the results obtained so far.
|
|
5149
|
+
*/
|
|
5150
|
+
abortLinkReliabilityCheck() {
|
|
5151
|
+
this._linkReliabilityCheckAborted = true;
|
|
5152
|
+
this._abortLinkReliabilityCheckPromise?.resolve();
|
|
5153
|
+
}
|
|
5154
|
+
/**
|
|
5155
|
+
* Tests the reliability of the link between the controller and this node and returns the results.
|
|
5156
|
+
*/
|
|
5157
|
+
async checkLinkReliability(options) {
|
|
5158
|
+
if (this._linkReliabilityCheckInProgress) {
|
|
5159
|
+
throw new core_1.ZWaveError("A link reliability check is already in progress for this node!", core_1.ZWaveErrorCodes.LinkReliabilityCheck_Busy);
|
|
5160
|
+
}
|
|
5161
|
+
if (typeof options.rounds === "number" && options.rounds < 1) {
|
|
5162
|
+
throw new core_1.ZWaveError("The number of rounds must be at least 1!", core_1.ZWaveErrorCodes.Argument_Invalid);
|
|
5163
|
+
}
|
|
5164
|
+
try {
|
|
5165
|
+
this._linkReliabilityCheckInProgress = true;
|
|
5166
|
+
this._abortLinkReliabilityCheckPromise = (0, deferred_promise_1.createDeferredPromise)();
|
|
5167
|
+
switch (options.mode) {
|
|
5168
|
+
case _Types_1.LinkReliabilityCheckMode.BasicSetOnOff:
|
|
5169
|
+
return await this.checkLinkReliabilityBasicSetOnOff(options);
|
|
5170
|
+
}
|
|
5171
|
+
}
|
|
5172
|
+
finally {
|
|
5173
|
+
this._linkReliabilityCheckInProgress = false;
|
|
5174
|
+
this._linkReliabilityCheckAborted = false;
|
|
5175
|
+
this._abortLinkReliabilityCheckPromise = undefined;
|
|
5176
|
+
}
|
|
5177
|
+
}
|
|
5178
|
+
async checkLinkReliabilityBasicSetOnOff(options) {
|
|
5179
|
+
this.driver.controllerLog.logNode(this.id, `Starting link reliability check (Basic Set On/Off) with ${options.rounds} round${options.rounds !== 1 ? "s" : ""}...`);
|
|
5180
|
+
const useSupervision = this.supportsCC(core_1.CommandClasses.Supervision);
|
|
5181
|
+
const result = {
|
|
5182
|
+
rounds: 0,
|
|
5183
|
+
commandsSent: 0,
|
|
5184
|
+
commandErrors: 0,
|
|
5185
|
+
missingResponses: useSupervision ? 0 : undefined,
|
|
5186
|
+
latency: {
|
|
5187
|
+
min: Number.POSITIVE_INFINITY,
|
|
5188
|
+
max: 0,
|
|
5189
|
+
average: 0,
|
|
5190
|
+
},
|
|
5191
|
+
ackRSSI: {
|
|
5192
|
+
min: 0,
|
|
5193
|
+
max: Number.NEGATIVE_INFINITY,
|
|
5194
|
+
average: Number.NEGATIVE_INFINITY,
|
|
5195
|
+
},
|
|
5196
|
+
responseRSSI: useSupervision
|
|
5197
|
+
? {
|
|
5198
|
+
min: 0,
|
|
5199
|
+
max: Number.NEGATIVE_INFINITY,
|
|
5200
|
+
average: Number.NEGATIVE_INFINITY,
|
|
5201
|
+
}
|
|
5202
|
+
: undefined,
|
|
5203
|
+
};
|
|
5204
|
+
const aborted = () => {
|
|
5205
|
+
this.driver.controllerLog.logNode(this.id, `Link reliability check aborted`);
|
|
5206
|
+
return result;
|
|
5207
|
+
};
|
|
5208
|
+
let lastProgressReport = 0;
|
|
5209
|
+
const reportProgress = () => {
|
|
5210
|
+
if (Date.now() - lastProgressReport >= 250) {
|
|
5211
|
+
options.onProgress?.((0, shared_1.cloneDeep)(result));
|
|
5212
|
+
lastProgressReport = Date.now();
|
|
5213
|
+
}
|
|
5214
|
+
};
|
|
5215
|
+
if (this.canSleep && this.status !== _Types_2.NodeStatus.Awake) {
|
|
5216
|
+
// Wait for node to wake up to avoid incorrectly long delays in the first health check round
|
|
5217
|
+
this.driver.controllerLog.logNode(this.id, `waiting for node to wake up...`);
|
|
5218
|
+
await Promise.race([
|
|
5219
|
+
this.waitForWakeup(),
|
|
5220
|
+
this._abortLinkReliabilityCheckPromise,
|
|
5221
|
+
]);
|
|
5222
|
+
if (this._linkReliabilityCheckAborted)
|
|
5223
|
+
return aborted();
|
|
5224
|
+
}
|
|
5225
|
+
// TODO: report progress with throttle
|
|
5226
|
+
let txReport;
|
|
5227
|
+
let latency = 0;
|
|
5228
|
+
const basicSetAPI = this.commandClasses.Basic.withOptions({
|
|
5229
|
+
// Don't change the node status when the ACK is missing. We're likely testing the limits here.
|
|
5230
|
+
changeNodeStatusOnMissingACK: false,
|
|
5231
|
+
// Avoid using explorer frames, because they can create a ton of delay
|
|
5232
|
+
transmitOptions: core_1.TransmitOptions.ACK
|
|
5233
|
+
| core_1.TransmitOptions.AutoRoute,
|
|
5234
|
+
// And remember the transmit report, so we can evaluate it
|
|
5235
|
+
onTXReport: (report) => {
|
|
5236
|
+
txReport = report;
|
|
5237
|
+
},
|
|
5238
|
+
});
|
|
5239
|
+
let lastStart;
|
|
5240
|
+
for (let round = 1; round <= (options.rounds ?? Number.POSITIVE_INFINITY); round++) {
|
|
5241
|
+
if (this._linkReliabilityCheckAborted)
|
|
5242
|
+
return aborted();
|
|
5243
|
+
result.rounds = round;
|
|
5244
|
+
lastStart = Date.now();
|
|
5245
|
+
// Reset TX report before each command
|
|
5246
|
+
txReport = undefined;
|
|
5247
|
+
try {
|
|
5248
|
+
await basicSetAPI.set(round % 2 === 1 ? 0xff : 0x00);
|
|
5249
|
+
// The command was sent successfully (and possibly got a response)
|
|
5250
|
+
result.commandsSent++;
|
|
5251
|
+
// Measure the RTT or latency, whatever is available
|
|
5252
|
+
const rtt = Date.now() - lastStart;
|
|
5253
|
+
latency = Math.max(latency, txReport ? txReport.txTicks * 10 : rtt);
|
|
5254
|
+
result.latency.min = Math.min(result.latency.min, latency);
|
|
5255
|
+
result.latency.max = Math.max(result.latency.max, latency);
|
|
5256
|
+
// incrementally update the average latency
|
|
5257
|
+
result.latency.average += (latency - result.latency.average)
|
|
5258
|
+
/ round;
|
|
5259
|
+
}
|
|
5260
|
+
catch (e) {
|
|
5261
|
+
if ((0, core_1.isZWaveError)(e)) {
|
|
5262
|
+
if (e.code === core_1.ZWaveErrorCodes.Controller_ResponseNOK
|
|
5263
|
+
|| e.code === core_1.ZWaveErrorCodes.Controller_CallbackNOK) {
|
|
5264
|
+
// The command could not be sent or was not acknowledged
|
|
5265
|
+
result.commandErrors++;
|
|
5266
|
+
}
|
|
5267
|
+
else if (e.code === core_1.ZWaveErrorCodes.Controller_NodeTimeout) {
|
|
5268
|
+
// The command was sent using Supervision and a response was
|
|
5269
|
+
// expected but none came
|
|
5270
|
+
result.missingResponses ??= 0;
|
|
5271
|
+
result.missingResponses++;
|
|
5272
|
+
}
|
|
5273
|
+
}
|
|
5274
|
+
}
|
|
5275
|
+
if (txReport?.ackRSSI != undefined
|
|
5276
|
+
&& !(0, core_1.isRssiError)(txReport.ackRSSI)) {
|
|
5277
|
+
result.ackRSSI.min = Math.min(result.ackRSSI.min, txReport.ackRSSI);
|
|
5278
|
+
result.ackRSSI.max = Math.max(result.ackRSSI.max, txReport.ackRSSI);
|
|
5279
|
+
// incrementally update the average RSSI
|
|
5280
|
+
if (Number.isFinite(result.ackRSSI.average)) {
|
|
5281
|
+
result.ackRSSI.average +=
|
|
5282
|
+
(txReport.ackRSSI - result.ackRSSI.average)
|
|
5283
|
+
/ round;
|
|
5284
|
+
}
|
|
5285
|
+
else {
|
|
5286
|
+
result.ackRSSI.average = txReport.ackRSSI;
|
|
5287
|
+
}
|
|
5288
|
+
}
|
|
5289
|
+
// TODO: Capture incoming RSSI and average it
|
|
5290
|
+
reportProgress();
|
|
5291
|
+
// Throttle the next command
|
|
5292
|
+
const waitDurationMs = Math.max(0, options.interval - (Date.now() - lastStart));
|
|
5293
|
+
await Promise.race([
|
|
5294
|
+
(0, async_1.wait)(waitDurationMs, true),
|
|
5295
|
+
this._abortLinkReliabilityCheckPromise,
|
|
5296
|
+
]);
|
|
5297
|
+
}
|
|
5298
|
+
return result;
|
|
5299
|
+
}
|
|
5134
5300
|
/**
|
|
5135
5301
|
* Updates the average RTT of this node
|
|
5136
5302
|
* @internal
|
|
@@ -5429,7 +5595,7 @@ ${(0, HealthCheck_1.formatRouteHealthCheckSummary)(this.id, otherNode.id, summar
|
|
|
5429
5595
|
*/
|
|
5430
5596
|
hasDeviceConfigChanged() {
|
|
5431
5597
|
// We can't know if the node is not fully interviewed
|
|
5432
|
-
if (this.interviewStage !==
|
|
5598
|
+
if (this.interviewStage !== _Types_2.InterviewStage.Complete)
|
|
5433
5599
|
return core_1.NOT_KNOWN;
|
|
5434
5600
|
// The controller cannot be re-interviewed
|
|
5435
5601
|
if (this.isControllerNode)
|
|
@@ -5465,7 +5631,7 @@ ${(0, HealthCheck_1.formatRouteHealthCheckSummary)(this.id, otherNode.id, summar
|
|
|
5465
5631
|
: "unknown",
|
|
5466
5632
|
firmwareVersion: this.firmwareVersion ?? "unknown",
|
|
5467
5633
|
},
|
|
5468
|
-
interviewStage: (0, shared_1.getEnumMemberName)(
|
|
5634
|
+
interviewStage: (0, shared_1.getEnumMemberName)(_Types_2.InterviewStage, this.interviewStage),
|
|
5469
5635
|
ready: this.ready,
|
|
5470
5636
|
dsk: this.dsk ? (0, core_1.dskToString)(this.dsk) : undefined,
|
|
5471
5637
|
securityClasses: {},
|