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.
Files changed (122) hide show
  1. package/build/cjs/lib/_version.d.ts +1 -1
  2. package/build/cjs/lib/_version.js +1 -1
  3. package/build/cjs/lib/_version.js.map +1 -1
  4. package/build/cjs/lib/controller/Controller.js +66 -60
  5. package/build/cjs/lib/controller/Controller.js.map +1 -1
  6. package/build/cjs/lib/controller/ControllerStatistics.js +4 -0
  7. package/build/cjs/lib/controller/ControllerStatistics.js.map +1 -1
  8. package/build/cjs/lib/controller/FirmwareUpdateService.js +8 -0
  9. package/build/cjs/lib/controller/FirmwareUpdateService.js.map +1 -1
  10. package/build/cjs/lib/controller/MockControllerBehaviors.js +3 -0
  11. package/build/cjs/lib/controller/MockControllerBehaviors.js.map +1 -1
  12. package/build/cjs/lib/controller/NVMIO.js +7 -0
  13. package/build/cjs/lib/controller/NVMIO.js.map +1 -1
  14. package/build/cjs/lib/controller/NodeInformationFrame.js +2 -0
  15. package/build/cjs/lib/controller/NodeInformationFrame.js.map +1 -1
  16. package/build/cjs/lib/controller/ZWaveSDKVersions.js +3 -0
  17. package/build/cjs/lib/controller/ZWaveSDKVersions.js.map +1 -1
  18. package/build/cjs/lib/controller/utils.js +4 -0
  19. package/build/cjs/lib/controller/utils.js.map +1 -1
  20. package/build/cjs/lib/driver/Bootloader.js +4 -0
  21. package/build/cjs/lib/driver/Bootloader.js.map +1 -1
  22. package/build/cjs/lib/driver/Driver.js +63 -56
  23. package/build/cjs/lib/driver/Driver.js.map +1 -1
  24. package/build/cjs/lib/driver/DriverMock.js +6 -3
  25. package/build/cjs/lib/driver/DriverMock.js.map +1 -1
  26. package/build/cjs/lib/driver/MessageGenerators.js +26 -18
  27. package/build/cjs/lib/driver/MessageGenerators.js.map +1 -1
  28. package/build/cjs/lib/driver/NetworkCache.js +43 -23
  29. package/build/cjs/lib/driver/NetworkCache.js.map +1 -1
  30. package/build/cjs/lib/driver/Queue.js +6 -2
  31. package/build/cjs/lib/driver/Queue.js.map +1 -1
  32. package/build/cjs/lib/driver/SerialAPICommandMachine.js +45 -40
  33. package/build/cjs/lib/driver/SerialAPICommandMachine.js.map +1 -1
  34. package/build/cjs/lib/driver/StateMachineShared.js +5 -0
  35. package/build/cjs/lib/driver/StateMachineShared.js.map +1 -1
  36. package/build/cjs/lib/driver/Statistics.js +4 -0
  37. package/build/cjs/lib/driver/Statistics.js.map +1 -1
  38. package/build/cjs/lib/driver/Task.js +9 -2
  39. package/build/cjs/lib/driver/Task.js.map +1 -1
  40. package/build/cjs/lib/driver/Transaction.js +8 -4
  41. package/build/cjs/lib/driver/Transaction.js.map +1 -1
  42. package/build/cjs/lib/driver/TransportServiceMachine.js +9 -7
  43. package/build/cjs/lib/driver/TransportServiceMachine.js.map +1 -1
  44. package/build/cjs/lib/driver/UpdateConfig.js +8 -4
  45. package/build/cjs/lib/driver/UpdateConfig.js.map +1 -1
  46. package/build/cjs/lib/driver/UserAgent.js +4 -0
  47. package/build/cjs/lib/driver/UserAgent.js.map +1 -1
  48. package/build/cjs/lib/driver/mDNSDiscovery.js +2 -0
  49. package/build/cjs/lib/driver/mDNSDiscovery.js.map +1 -1
  50. package/build/cjs/lib/log/Driver.js +6 -2
  51. package/build/cjs/lib/log/Driver.js.map +1 -1
  52. package/build/cjs/lib/log/Zniffer.js +6 -2
  53. package/build/cjs/lib/log/Zniffer.js.map +1 -1
  54. package/build/cjs/lib/node/DeviceClass.js +4 -0
  55. package/build/cjs/lib/node/DeviceClass.js.map +1 -1
  56. package/build/cjs/lib/node/Endpoint.js +9 -5
  57. package/build/cjs/lib/node/Endpoint.js.map +1 -1
  58. package/build/cjs/lib/node/HealthCheck.js +6 -0
  59. package/build/cjs/lib/node/HealthCheck.js.map +1 -1
  60. package/build/cjs/lib/node/MockNodeBehaviors.js +2 -0
  61. package/build/cjs/lib/node/MockNodeBehaviors.js.map +1 -1
  62. package/build/cjs/lib/node/MultiCCAPIWrapper.js +10 -8
  63. package/build/cjs/lib/node/MultiCCAPIWrapper.js.map +1 -1
  64. package/build/cjs/lib/node/Node.js +51 -46
  65. package/build/cjs/lib/node/Node.js.map +1 -1
  66. package/build/cjs/lib/node/NodeReadyMachine.js +3 -1
  67. package/build/cjs/lib/node/NodeReadyMachine.js.map +1 -1
  68. package/build/cjs/lib/node/NodeStatistics.js +5 -0
  69. package/build/cjs/lib/node/NodeStatistics.js.map +1 -1
  70. package/build/cjs/lib/node/NodeStatusMachine.js +5 -2
  71. package/build/cjs/lib/node/NodeStatusMachine.js.map +1 -1
  72. package/build/cjs/lib/node/VirtualEndpoint.js +8 -4
  73. package/build/cjs/lib/node/VirtualEndpoint.js.map +1 -1
  74. package/build/cjs/lib/node/VirtualNode.js +7 -2
  75. package/build/cjs/lib/node/VirtualNode.js.map +1 -1
  76. package/build/cjs/lib/node/mixins/00_Base.js +4 -0
  77. package/build/cjs/lib/node/mixins/00_Base.js.map +1 -1
  78. package/build/cjs/lib/node/mixins/01_NetworkRole.js +4 -0
  79. package/build/cjs/lib/node/mixins/01_NetworkRole.js.map +1 -1
  80. package/build/cjs/lib/node/mixins/05_Security.js +7 -3
  81. package/build/cjs/lib/node/mixins/05_Security.js.map +1 -1
  82. package/build/cjs/lib/node/mixins/10_Events.js +4 -0
  83. package/build/cjs/lib/node/mixins/10_Events.js.map +1 -1
  84. package/build/cjs/lib/node/mixins/20_Status.js +4 -0
  85. package/build/cjs/lib/node/mixins/20_Status.js.map +1 -1
  86. package/build/cjs/lib/node/mixins/30_Wakeup.js +4 -0
  87. package/build/cjs/lib/node/mixins/30_Wakeup.js.map +1 -1
  88. package/build/cjs/lib/node/mixins/40_Values.js +4 -0
  89. package/build/cjs/lib/node/mixins/40_Values.js.map +1 -1
  90. package/build/cjs/lib/node/mixins/50_Endpoints.js +4 -0
  91. package/build/cjs/lib/node/mixins/50_Endpoints.js.map +1 -1
  92. package/build/cjs/lib/node/mixins/60_ScheduledPoll.js +4 -0
  93. package/build/cjs/lib/node/mixins/60_ScheduledPoll.js.map +1 -1
  94. package/build/cjs/lib/node/mixins/70_FirmwareUpdate.js +8 -3
  95. package/build/cjs/lib/node/mixins/70_FirmwareUpdate.js.map +1 -1
  96. package/build/cjs/lib/node/mixins/index.js +4 -0
  97. package/build/cjs/lib/node/mixins/index.js.map +1 -1
  98. package/build/cjs/lib/node/mockCCBehaviors/ColorSwitch.js +2 -1
  99. package/build/cjs/lib/node/mockCCBehaviors/ColorSwitch.js.map +1 -1
  100. package/build/cjs/lib/node/mockCCBehaviors/Configuration.js +2 -1
  101. package/build/cjs/lib/node/mockCCBehaviors/Configuration.js.map +1 -1
  102. package/build/cjs/lib/node/mockCCBehaviors/ScheduleEntryLock.js +2 -1
  103. package/build/cjs/lib/node/mockCCBehaviors/ScheduleEntryLock.js.map +1 -1
  104. package/build/cjs/lib/node/mockCCBehaviors/ThermostatSetpoint.js +3 -2
  105. package/build/cjs/lib/node/mockCCBehaviors/ThermostatSetpoint.js.map +1 -1
  106. package/build/cjs/lib/node/mockCCBehaviors/UserCode.js +3 -2
  107. package/build/cjs/lib/node/mockCCBehaviors/UserCode.js.map +1 -1
  108. package/build/cjs/lib/node/utils.js +22 -2
  109. package/build/cjs/lib/node/utils.js.map +1 -1
  110. package/build/cjs/lib/telemetry/deviceConfig.js +2 -0
  111. package/build/cjs/lib/telemetry/deviceConfig.js.map +1 -1
  112. package/build/cjs/lib/telemetry/statistics.js +3 -0
  113. package/build/cjs/lib/telemetry/statistics.js.map +1 -1
  114. package/build/cjs/lib/zniffer/MPDU.js +57 -0
  115. package/build/cjs/lib/zniffer/MPDU.js.map +1 -1
  116. package/build/cjs/lib/zniffer/Zniffer.js +10 -3
  117. package/build/cjs/lib/zniffer/Zniffer.js.map +1 -1
  118. package/build/cjs/mockServer.js +14 -0
  119. package/build/cjs/mockServer.js.map +1 -1
  120. package/build/esm/lib/_version.d.ts +1 -1
  121. package/build/esm/lib/_version.js +1 -1
  122. 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 });
@@ -238,9 +239,11 @@ function checkOptions(options) {
238
239
  }
239
240
  }
240
241
  }
242
+ __name(checkOptions, "checkOptions");
241
243
  function messageIsPing(msg) {
242
244
  return (0, import_serialapi9.containsCC)(msg) && msg.command instanceof import_cc.NoOperationCC;
243
245
  }
246
+ __name(messageIsPing, "messageIsPing");
244
247
  function assertValidCCs(container) {
245
248
  if (container.command instanceof import_cc.InvalidCC) {
246
249
  if (typeof container.command.reason === "number") {
@@ -252,7 +255,11 @@ function assertValidCCs(container) {
252
255
  assertValidCCs(container.command);
253
256
  }
254
257
  }
258
+ __name(assertValidCCs, "assertValidCCs");
255
259
  class Driver extends import_shared.TypedEventEmitter {
260
+ static {
261
+ __name(this, "Driver");
262
+ }
256
263
  port;
257
264
  constructor(port, ...optionsAndPresets) {
258
265
  super();
@@ -284,10 +291,10 @@ class Driver extends import_shared.TypedEventEmitter {
284
291
  });
285
292
  const self = this;
286
293
  this.messageEncodingContext = {
287
- getHighestSecurityClass: (nodeId) => this.getHighestSecurityClass(nodeId),
288
- hasSecurityClass: (nodeId, securityClass) => this.hasSecurityClass(nodeId, securityClass),
289
- setSecurityClass: (nodeId, securityClass, granted) => this.setSecurityClass(nodeId, securityClass, granted),
290
- getDeviceConfig: (nodeId) => this.getDeviceConfig(nodeId),
294
+ getHighestSecurityClass: /* @__PURE__ */ __name((nodeId) => this.getHighestSecurityClass(nodeId), "getHighestSecurityClass"),
295
+ hasSecurityClass: /* @__PURE__ */ __name((nodeId, securityClass) => this.hasSecurityClass(nodeId, securityClass), "hasSecurityClass"),
296
+ setSecurityClass: /* @__PURE__ */ __name((nodeId, securityClass, granted) => this.setSecurityClass(nodeId, securityClass, granted), "setSecurityClass"),
297
+ getDeviceConfig: /* @__PURE__ */ __name((nodeId) => this.getDeviceConfig(nodeId), "getDeviceConfig"),
291
298
  // These are evaluated lazily, so we cannot spread messageParsingContext unfortunately
292
299
  get securityManager() {
293
300
  return self.securityManager;
@@ -298,11 +305,11 @@ class Driver extends import_shared.TypedEventEmitter {
298
305
  get securityManagerLR() {
299
306
  return self.securityManagerLR;
300
307
  },
301
- getSupportedCCVersion: (cc, nodeId, endpointIndex) => this.getSupportedCCVersion(cc, nodeId, endpointIndex)
308
+ getSupportedCCVersion: /* @__PURE__ */ __name((cc, nodeId, endpointIndex) => this.getSupportedCCVersion(cc, nodeId, endpointIndex), "getSupportedCCVersion")
302
309
  };
303
310
  this.immediateQueue = new import_Queue.TransactionQueue({
304
311
  name: "immediate",
305
- mayStartNextTransaction: (t) => {
312
+ mayStartNextTransaction: /* @__PURE__ */ __name((t) => {
306
313
  if (this.controller.status === import_core.ControllerStatus.Unresponsive) {
307
314
  return t.message instanceof import_serialapi4.SoftResetRequest || t.message instanceof import_serialapi3.GetControllerVersionRequest;
308
315
  }
@@ -310,11 +317,11 @@ class Driver extends import_shared.TypedEventEmitter {
310
317
  return t.message instanceof import_serialapi4.SoftResetRequest;
311
318
  }
312
319
  return !this.queuePaused && this.controller.status === import_core.ControllerStatus.Ready;
313
- }
320
+ }, "mayStartNextTransaction")
314
321
  });
315
322
  this.queue = new import_Queue.TransactionQueue({
316
323
  name: "normal",
317
- mayStartNextTransaction: (t) => this.mayStartTransaction(t)
324
+ mayStartNextTransaction: /* @__PURE__ */ __name((t) => this.mayStartTransaction(t), "mayStartNextTransaction")
318
325
  });
319
326
  this.serialAPIQueue = new import_shared.AsyncQueue();
320
327
  this._queueIdle = false;
@@ -333,7 +340,7 @@ class Driver extends import_shared.TypedEventEmitter {
333
340
  }
334
341
  getMessageParsingContext() {
335
342
  return {
336
- getDeviceConfig: (nodeId) => this.getDeviceConfig(nodeId),
343
+ getDeviceConfig: /* @__PURE__ */ __name((nodeId) => this.getDeviceConfig(nodeId), "getDeviceConfig"),
337
344
  sdkVersion: this._controller?.sdkVersion,
338
345
  requestStorage: this._requestStorage,
339
346
  ownNodeId: this.controller.ownNodeId,
@@ -871,8 +878,8 @@ class Driver extends import_shared.TypedEventEmitter {
871
878
  this._valueDB = new import_jsonl_db.JsonlDB(valueDBFile, {
872
879
  ...options,
873
880
  enableTimestamps: true,
874
- reviver: (key, value) => (0, import_core.deserializeCacheValue)(value),
875
- serializer: (key, value) => (0, import_core.serializeCacheValue)(value)
881
+ reviver: /* @__PURE__ */ __name((key, value) => (0, import_core.deserializeCacheValue)(value), "reviver"),
882
+ serializer: /* @__PURE__ */ __name((key, value) => (0, import_core.serializeCacheValue)(value), "serializer")
876
883
  });
877
884
  await this._valueDB.open();
878
885
  const metadataDBFile = import_node_path.default.join(this.cacheDir, `${homeId.toString(16)}.metadata.jsonl`);
@@ -1506,7 +1513,7 @@ class Driver extends import_shared.TypedEventEmitter {
1506
1513
  }
1507
1514
  }
1508
1515
  /** This is called when a node emits a `"notification"` event */
1509
- onNodeNotification = (endpoint, ccId, ccArgs) => {
1516
+ onNodeNotification = /* @__PURE__ */ __name((endpoint, ccId, ccArgs) => {
1510
1517
  let prefix;
1511
1518
  let details;
1512
1519
  if (ccId === import_core.CommandClasses.Notification) {
@@ -1544,7 +1551,7 @@ class Driver extends import_shared.TypedEventEmitter {
1544
1551
  endpoint: endpoint.index,
1545
1552
  message: [prefix, ...details.map((d) => ` ${d}`)].join("\n")
1546
1553
  });
1547
- };
1554
+ }, "onNodeNotification");
1548
1555
  /** Checks if there are any pending messages for the given node */
1549
1556
  hasPendingMessages(node) {
1550
1557
  if (this.hasPendingTransactions((t) => t.message.getNodeId() === node.id)) {
@@ -1770,7 +1777,7 @@ class Driver extends import_shared.TypedEventEmitter {
1770
1777
  return true;
1771
1778
  }
1772
1779
  this.controllerLog.print("Did not receive notification that Serial API has started, checking if it responds...");
1773
- const pollController = async () => {
1780
+ const pollController = /* @__PURE__ */ __name(async () => {
1774
1781
  try {
1775
1782
  this.unpauseSendQueue();
1776
1783
  await this.sendMessage(new import_serialapi3.GetControllerVersionRequest(), {
@@ -1783,7 +1790,7 @@ class Driver extends import_shared.TypedEventEmitter {
1783
1790
  } catch {
1784
1791
  return false;
1785
1792
  }
1786
- };
1793
+ }, "pollController");
1787
1794
  if (await pollController())
1788
1795
  return true;
1789
1796
  for (const backoff of [2, 5, 10, 15]) {
@@ -2190,7 +2197,7 @@ ${(0, import_shared.buffer2hex)(data)}`, "warn");
2190
2197
  version: 1
2191
2198
  });
2192
2199
  }
2193
- const isS2NonceReport = (t) => t.message.getNodeId() === nodeId && (0, import_serialapi9.containsCC)(t.message) && t.message.command instanceof import_cc.Security2CCNonceReport;
2200
+ const isS2NonceReport = /* @__PURE__ */ __name((t) => t.message.getNodeId() === nodeId && (0, import_serialapi9.containsCC)(t.message) && t.message.command instanceof import_cc.Security2CCNonceReport, "isS2NonceReport");
2194
2201
  const message = e.code === import_core.ZWaveErrorCodes.Security2CC_CannotDecode ? "Message authentication failed" : "No SPAN is established yet";
2195
2202
  if (this.controller.bootstrappingS2NodeId === nodeId) {
2196
2203
  const securityManager = this.getSecurityManager2(nodeId);
@@ -2303,7 +2310,7 @@ ${(0, import_shared.buffer2hex)(data)}`, "warn");
2303
2310
  if (!this._controller || !this.mayRecoverUnresponsiveController()) {
2304
2311
  return false;
2305
2312
  }
2306
- const recoverByReopeningSerialport = async () => {
2313
+ const recoverByReopeningSerialport = /* @__PURE__ */ __name(async () => {
2307
2314
  if (!this.serial)
2308
2315
  return;
2309
2316
  this.driverLog.print("Attempting to recover unresponsive controller by reopening the serial port...", "warn");
@@ -2314,7 +2321,7 @@ ${(0, import_shared.buffer2hex)(data)}`, "warn");
2314
2321
  this.driverLog.print("Serial port reopened. Returning to normal operation and hoping for the best...", "warn");
2315
2322
  this._controller?.setStatus(import_core.ControllerStatus.Ready);
2316
2323
  this._recoveryPhase = 0;
2317
- };
2324
+ }, "recoverByReopeningSerialport");
2318
2325
  if (this._controller.status !== import_core.ControllerStatus.Unresponsive && !this.maySoftReset() || this._recoveryPhase === 2) {
2319
2326
  void recoverByReopeningSerialport().catch(import_shared.noop);
2320
2327
  return true;
@@ -2548,7 +2555,7 @@ ${(0, import_shared.buffer2hex)(data)}`, "warn");
2548
2555
  direction: "inbound"
2549
2556
  });
2550
2557
  const RXStateMachine = (0, import_TransportServiceMachine.createTransportServiceRXMachine)({
2551
- requestMissingSegment: async (offset) => {
2558
+ requestMissingSegment: /* @__PURE__ */ __name(async (offset) => {
2552
2559
  this.controllerLog.logNode(command.nodeId, {
2553
2560
  message: `Transport Service RX session #${command.sessionId}: Segment with offset ${offset} missing - requesting it...`,
2554
2561
  level: "debug",
@@ -2563,8 +2570,8 @@ ${(0, import_shared.buffer2hex)(data)}`, "warn");
2563
2570
  maxSendAttempts: 1,
2564
2571
  priority: import_core.MessagePriority.Immediate
2565
2572
  });
2566
- },
2567
- sendSegmentsComplete: async () => {
2573
+ }, "requestMissingSegment"),
2574
+ sendSegmentsComplete: /* @__PURE__ */ __name(async () => {
2568
2575
  this.controllerLog.logNode(command.nodeId, {
2569
2576
  message: `Transport Service RX session #${command.sessionId} complete`,
2570
2577
  level: "debug",
@@ -2578,7 +2585,7 @@ ${(0, import_shared.buffer2hex)(data)}`, "warn");
2578
2585
  maxSendAttempts: 1,
2579
2586
  priority: import_core.MessagePriority.Immediate
2580
2587
  });
2581
- }
2588
+ }, "sendSegmentsComplete")
2582
2589
  }, {
2583
2590
  // TODO: Figure out how to know which timeout is the correct one. For now use the larger one
2584
2591
  missingSegmentTimeout: import_cc.TransportServiceTimeouts.requestMissingSegmentR2,
@@ -2725,7 +2732,7 @@ ${handlers.length} left`);
2725
2732
  return false;
2726
2733
  }
2727
2734
  const expectedSecurityCC = (0, import_core.securityClassIsS2)(secClass) ? import_core.CommandClasses["Security 2"] : secClass === import_core.SecurityClass.S0_Legacy ? import_core.CommandClasses.Security : void 0;
2728
- const isCCConsideredSecure = (cmd) => {
2735
+ const isCCConsideredSecure = /* @__PURE__ */ __name((cmd) => {
2729
2736
  if (cmd instanceof import_cc.SecurityCC) {
2730
2737
  switch (cmd.ccCommand) {
2731
2738
  // Cannot be sent encapsulated:
@@ -2757,7 +2764,7 @@ ${handlers.length} left`);
2757
2764
  }
2758
2765
  }
2759
2766
  return cmd.ccId === expectedSecurityCC;
2760
- };
2767
+ }, "isCCConsideredSecure");
2761
2768
  let requiresSecurity = (0, import_core.securityClassIsS2)(secClass);
2762
2769
  const isSecure = isCCConsideredSecure(cc);
2763
2770
  while (true) {
@@ -2860,16 +2867,16 @@ ${handlers.length} left`);
2860
2867
  let reply;
2861
2868
  if (supervisionSessionId != void 0) {
2862
2869
  const endpoint = node.getEndpoint(msg.command.endpointIndex) ?? node;
2863
- reply = (status) => endpoint.createAPI(import_core.CommandClasses.Supervision, false).withOptions({ s2MulticastOutOfSync }).sendReport({
2870
+ reply = /* @__PURE__ */ __name((status) => endpoint.createAPI(import_core.CommandClasses.Supervision, false).withOptions({ s2MulticastOutOfSync }).sendReport({
2864
2871
  sessionId: supervisionSessionId,
2865
2872
  moreUpdatesFollow: false,
2866
2873
  status,
2867
2874
  requestWakeUpOnDemand: this.shouldRequestWakeupOnDemand(node),
2868
2875
  encapsulationFlags,
2869
2876
  lowPriority: this.shouldUseLowPriorityForSupervisionReport(node, encapsulationFlags)
2870
- });
2877
+ }), "reply");
2871
2878
  } else {
2872
- reply = () => Promise.resolve();
2879
+ reply = /* @__PURE__ */ __name(() => Promise.resolve(), "reply");
2873
2880
  }
2874
2881
  if (supervisionSessionId == void 0 && s2MulticastOutOfSync) {
2875
2882
  node.commandClasses["Security 2"].sendMOS().catch(() => {
@@ -3264,12 +3271,12 @@ ${handlers.length} left`);
3264
3271
  msg.callbackId = this.getNextCallbackId();
3265
3272
  }
3266
3273
  const machine = (0, import_SerialAPICommandMachine.createSerialAPICommandMachine)(msg, await msg.serializeAsync(this.getEncodingContext()), {
3267
- sendData: (data) => this.writeSerial(data),
3268
- sendDataAbort: () => this.abortSendData(),
3269
- notifyUnsolicited: (msg2) => {
3274
+ sendData: /* @__PURE__ */ __name((data) => this.writeSerial(data), "sendData"),
3275
+ sendDataAbort: /* @__PURE__ */ __name(() => this.abortSendData(), "sendDataAbort"),
3276
+ notifyUnsolicited: /* @__PURE__ */ __name((msg2) => {
3270
3277
  void this.handleUnsolicitedMessage(msg2);
3271
- },
3272
- notifyRetry: (lastError, message, attempts, maxAttempts, delay) => {
3278
+ }, "notifyUnsolicited"),
3279
+ notifyRetry: /* @__PURE__ */ __name((lastError, message, attempts, maxAttempts, delay) => {
3273
3280
  let errorReason;
3274
3281
  switch (lastError) {
3275
3282
  case "response timeout":
@@ -3296,13 +3303,13 @@ ${handlers.length} left`);
3296
3303
  break;
3297
3304
  }
3298
3305
  this.controllerLog.print(`${errorReason} after ${attempts}/${maxAttempts} attempts. Scheduling next try in ${delay} ms.`, "warn");
3299
- },
3306
+ }, "notifyRetry"),
3300
3307
  timestamp: import_core.highResTimestamp,
3301
- logOutgoingMessage: (msg2) => {
3308
+ logOutgoingMessage: /* @__PURE__ */ __name((msg2) => {
3302
3309
  this.driverLog.logMessage(msg2, {
3303
3310
  direction: "outbound"
3304
3311
  });
3305
- }
3312
+ }, "logOutgoingMessage")
3306
3313
  }, (0, import_shared.pick)(this._options, ["timeouts", "attempts"]));
3307
3314
  const result = (0, import_deferred_promise.createDeferredPromise)();
3308
3315
  if (msg.functionType === import_serial.FunctionType.SoftReset && this.controller.sdkVersionGte("7.19.0")) {
@@ -3598,17 +3605,17 @@ ${handlers.length} left`);
3598
3605
  const promise = (0, import_deferred_promise.createDeferredPromise)();
3599
3606
  const entry = {
3600
3607
  predicate,
3601
- handler: (msg) => promise.resolve(msg),
3608
+ handler: /* @__PURE__ */ __name((msg) => promise.resolve(msg), "handler"),
3602
3609
  timeout: void 0
3603
3610
  };
3604
3611
  this.awaitedMessageHeaders.push(entry);
3605
- const removeEntry = () => {
3612
+ const removeEntry = /* @__PURE__ */ __name(() => {
3606
3613
  if (entry.timeout)
3607
3614
  clearTimeout(entry.timeout);
3608
3615
  const index = this.awaitedMessageHeaders.indexOf(entry);
3609
3616
  if (index !== -1)
3610
3617
  this.awaitedMessageHeaders.splice(index, 1);
3611
- };
3618
+ }, "removeEntry");
3612
3619
  entry.timeout = setTimeout(() => {
3613
3620
  removeEntry();
3614
3621
  reject(new import_core.ZWaveError(`Received no matching serial frame within the provided timeout!`, import_core.ZWaveErrorCodes.Controller_Timeout));
@@ -3633,17 +3640,17 @@ ${handlers.length} left`);
3633
3640
  const entry = {
3634
3641
  predicate,
3635
3642
  refreshPredicate,
3636
- handler: (msg) => promise.resolve(msg),
3643
+ handler: /* @__PURE__ */ __name((msg) => promise.resolve(msg), "handler"),
3637
3644
  timeout: void 0
3638
3645
  };
3639
3646
  this.awaitedMessages.push(entry);
3640
- const removeEntry = () => {
3647
+ const removeEntry = /* @__PURE__ */ __name(() => {
3641
3648
  if (entry.timeout)
3642
3649
  clearTimeout(entry.timeout);
3643
3650
  const index = this.awaitedMessages.indexOf(entry);
3644
3651
  if (index !== -1)
3645
3652
  this.awaitedMessages.splice(index, 1);
3646
- };
3653
+ }, "removeEntry");
3647
3654
  entry.timeout = setTimeout(() => {
3648
3655
  removeEntry();
3649
3656
  reject(new import_core.ZWaveError(`Received no matching message within the provided timeout!`, import_core.ZWaveErrorCodes.Controller_Timeout));
@@ -3664,17 +3671,17 @@ ${handlers.length} left`);
3664
3671
  const promise = (0, import_deferred_promise.createDeferredPromise)();
3665
3672
  const entry = {
3666
3673
  predicate,
3667
- handler: (cc) => promise.resolve(cc),
3674
+ handler: /* @__PURE__ */ __name((cc) => promise.resolve(cc), "handler"),
3668
3675
  timeout: void 0
3669
3676
  };
3670
3677
  this.awaitedCommands.push(entry);
3671
- const removeEntry = () => {
3678
+ const removeEntry = /* @__PURE__ */ __name(() => {
3672
3679
  if (entry.timeout)
3673
3680
  clearTimeout(entry.timeout);
3674
3681
  const index = this.awaitedCommands.indexOf(entry);
3675
3682
  if (index !== -1)
3676
3683
  this.awaitedCommands.splice(index, 1);
3677
- };
3684
+ }, "removeEntry");
3678
3685
  entry.timeout = setTimeout(() => {
3679
3686
  removeEntry();
3680
3687
  reject(new import_core.ZWaveError(`Received no matching command within the provided timeout!`, import_core.ZWaveErrorCodes.Controller_NodeTimeout));
@@ -3692,17 +3699,17 @@ ${handlers.length} left`);
3692
3699
  registerCommandHandler(predicate, handler) {
3693
3700
  const entry = {
3694
3701
  predicate,
3695
- handler: (cc) => handler(cc),
3702
+ handler: /* @__PURE__ */ __name((cc) => handler(cc), "handler"),
3696
3703
  timeout: void 0
3697
3704
  };
3698
3705
  this.awaitedCommands.push(entry);
3699
- const removeEntry = () => {
3706
+ const removeEntry = /* @__PURE__ */ __name(() => {
3700
3707
  if (entry.timeout)
3701
3708
  clearTimeout(entry.timeout);
3702
3709
  const index = this.awaitedCommands.indexOf(entry);
3703
3710
  if (index !== -1)
3704
3711
  this.awaitedCommands.splice(index, 1);
3705
- };
3712
+ }, "removeEntry");
3706
3713
  return {
3707
3714
  unregister: removeEntry
3708
3715
  };
@@ -3826,7 +3833,7 @@ ${handlers.length} left`);
3826
3833
  const dropQueued = [];
3827
3834
  let stopActive;
3828
3835
  const requeue = [];
3829
- const reduceTransaction = (transaction, source) => {
3836
+ const reduceTransaction = /* @__PURE__ */ __name((transaction, source) => {
3830
3837
  const reducerResult = reducer(transaction, source);
3831
3838
  switch (reducerResult.type) {
3832
3839
  case "drop":
@@ -3871,7 +3878,7 @@ ${handlers.length} left`);
3871
3878
  }
3872
3879
  break;
3873
3880
  }
3874
- };
3881
+ }, "reduceTransaction");
3875
3882
  for (const transaction of queue.transactions) {
3876
3883
  reduceTransaction(transaction, "queue");
3877
3884
  }
@@ -3987,13 +3994,13 @@ ${handlers.length} left`);
3987
3994
  if (this.sendNodeToSleepTimers.has(node.id)) {
3988
3995
  clearTimeout(this.sendNodeToSleepTimers.get(node.id));
3989
3996
  }
3990
- const sendNodeToSleep = (node2) => {
3997
+ const sendNodeToSleep = /* @__PURE__ */ __name((node2) => {
3991
3998
  this.sendNodeToSleepTimers.delete(node2.id);
3992
3999
  if (!this.hasPendingMessages(node2)) {
3993
4000
  void node2.sendNoMoreInformation().catch(() => {
3994
4001
  });
3995
4002
  }
3996
- };
4003
+ }, "sendNodeToSleep");
3997
4004
  if (node.supportsCC(import_core.CommandClasses["Wake Up"]) && !this.hasPendingMessages(node)) {
3998
4005
  const wakeUpInterval = node.getValue(import_cc.WakeUpCCValues.wakeUpInterval.id);
3999
4006
  if (wakeUpInterval !== 0) {
@@ -4224,17 +4231,17 @@ ${handlers.length} left`);
4224
4231
  const promise = (0, import_deferred_promise.createDeferredPromise)();
4225
4232
  const entry = {
4226
4233
  predicate,
4227
- handler: (chunk) => promise.resolve(chunk),
4234
+ handler: /* @__PURE__ */ __name((chunk) => promise.resolve(chunk), "handler"),
4228
4235
  timeout: void 0
4229
4236
  };
4230
4237
  this.awaitedBootloaderChunks.push(entry);
4231
- const removeEntry = () => {
4238
+ const removeEntry = /* @__PURE__ */ __name(() => {
4232
4239
  if (entry.timeout)
4233
4240
  clearTimeout(entry.timeout);
4234
4241
  const index = this.awaitedBootloaderChunks.indexOf(entry);
4235
4242
  if (index !== -1)
4236
4243
  this.awaitedBootloaderChunks.splice(index, 1);
4237
- };
4244
+ }, "removeEntry");
4238
4245
  entry.timeout = setTimeout(() => {
4239
4246
  removeEntry();
4240
4247
  reject(new import_core.ZWaveError(`Received no matching chunk within the provided timeout!`, import_core.ZWaveErrorCodes.Controller_Timeout));
@@ -4294,7 +4301,7 @@ ${handlers.length} left`);
4294
4301
  };
4295
4302
  this._powerlevelTestNodeContext = context;
4296
4303
  const interval = 50;
4297
- const sendFrame = async () => {
4304
+ const sendFrame = /* @__PURE__ */ __name(async () => {
4298
4305
  const result = await this.sendTestFrame(testNodeId, powerlevel);
4299
4306
  if (result === import_core.TransmitStatus.OK) {
4300
4307
  context.acknowledgedFrames++;
@@ -4306,7 +4313,7 @@ ${handlers.length} left`);
4306
4313
  context.timeout = void 0;
4307
4314
  ret.resolve(context.acknowledgedFrames);
4308
4315
  }
4309
- };
4316
+ }, "sendFrame");
4310
4317
  context.timeout = setTimeout(sendFrame, interval);
4311
4318
  return ret;
4312
4319
  }