zwave-js 15.0.0-beta.0 → 15.0.0-beta.2
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/Controller.d.ts +1 -2
- package/build/cjs/Controller.js +0 -3
- package/build/cjs/Controller.js.map +2 -2
- package/build/cjs/Controller_safe.d.ts +1 -2
- package/build/cjs/Controller_safe.js +0 -3
- package/build/cjs/Controller_safe.js.map +2 -2
- package/build/cjs/Driver.d.ts +2 -0
- package/build/cjs/Driver.js +3 -0
- package/build/cjs/Driver.js.map +2 -2
- 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.d.ts +1 -43
- package/build/cjs/lib/controller/Controller.js +8 -217
- package/build/cjs/lib/controller/Controller.js.map +3 -3
- package/build/cjs/lib/controller/_Types.d.ts +0 -22
- package/build/cjs/lib/controller/_Types.js +0 -19
- package/build/cjs/lib/controller/_Types.js.map +4 -4
- package/build/cjs/lib/driver/Driver.d.ts +19 -0
- package/build/cjs/lib/driver/Driver.js +225 -9
- package/build/cjs/lib/driver/Driver.js.map +3 -3
- package/build/cjs/lib/driver/_Types.d.ts +23 -0
- package/build/cjs/lib/driver/_Types.js +36 -0
- package/build/cjs/lib/driver/_Types.js.map +7 -0
- package/build/cjs/lib/node/mixins/70_FirmwareUpdate.js +1 -1
- package/build/cjs/lib/node/mixins/70_FirmwareUpdate.js.map +2 -2
- package/build/esm/Controller.d.ts +1 -2
- package/build/esm/Controller.d.ts.map +1 -1
- package/build/esm/Controller.js +0 -1
- package/build/esm/Controller.js.map +1 -1
- package/build/esm/Controller_safe.d.ts +1 -2
- package/build/esm/Controller_safe.d.ts.map +1 -1
- package/build/esm/Controller_safe.js +0 -1
- package/build/esm/Controller_safe.js.map +1 -1
- package/build/esm/Driver.d.ts +2 -0
- package/build/esm/Driver.d.ts.map +1 -1
- package/build/esm/Driver.js +1 -0
- package/build/esm/Driver.js.map +1 -1
- 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 +1 -43
- package/build/esm/lib/controller/Controller.d.ts.map +1 -1
- package/build/esm/lib/controller/Controller.js +9 -261
- package/build/esm/lib/controller/Controller.js.map +1 -1
- package/build/esm/lib/controller/_Types.d.ts +0 -22
- package/build/esm/lib/controller/_Types.d.ts.map +1 -1
- package/build/esm/lib/controller/_Types.js +1 -12
- package/build/esm/lib/controller/_Types.js.map +1 -1
- package/build/esm/lib/driver/Driver.d.ts +19 -0
- package/build/esm/lib/driver/Driver.d.ts.map +1 -1
- package/build/esm/lib/driver/Driver.js +276 -15
- package/build/esm/lib/driver/Driver.js.map +1 -1
- package/build/esm/lib/driver/_Types.d.ts +23 -0
- package/build/esm/lib/driver/_Types.d.ts.map +1 -0
- package/build/esm/lib/driver/_Types.js +13 -0
- package/build/esm/lib/driver/_Types.js.map +1 -0
- package/build/esm/lib/node/mixins/70_FirmwareUpdate.js +1 -1
- package/build/esm/lib/node/mixins/70_FirmwareUpdate.js.map +1 -1
- package/package.json +12 -12
|
@@ -8,6 +8,5 @@ export type { ControllerEvents } from "./lib/controller/Controller.js";
|
|
|
8
8
|
export type { ControllerStatistics } from "./lib/controller/ControllerStatistics.js";
|
|
9
9
|
export { ZWaveFeature } from "./lib/controller/Features.js";
|
|
10
10
|
export * from "./lib/controller/Inclusion.js";
|
|
11
|
-
export {
|
|
12
|
-
export type { ControllerFirmwareUpdateProgress, ControllerFirmwareUpdateResult, FirmwareUpdateDeviceID, FirmwareUpdateFileInfo, FirmwareUpdateInfo, GetFirmwareUpdatesOptions, RebuildRoutesOptions, RebuildRoutesStatus, SDKVersion, } from "./lib/controller/_Types.js";
|
|
11
|
+
export type { FirmwareUpdateDeviceID, FirmwareUpdateFileInfo, FirmwareUpdateInfo, GetFirmwareUpdatesOptions, RebuildRoutesOptions, RebuildRoutesStatus, SDKVersion, } from "./lib/controller/_Types.js";
|
|
13
12
|
//# sourceMappingURL=Controller.d.ts.map
|
package/build/cjs/Controller.js
CHANGED
|
@@ -19,7 +19,6 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var Controller_exports = {};
|
|
21
21
|
__export(Controller_exports, {
|
|
22
|
-
ControllerFirmwareUpdateStatus: () => import_Types.ControllerFirmwareUpdateStatus,
|
|
23
22
|
ProtocolDataRate: () => import_safe.ProtocolDataRate,
|
|
24
23
|
RFRegion: () => import_safe.RFRegion,
|
|
25
24
|
RssiError: () => import_safe.RssiError,
|
|
@@ -34,10 +33,8 @@ var import_serialapi = require("@zwave-js/serial/serialapi");
|
|
|
34
33
|
var import_Controller = require("./lib/controller/Controller.js");
|
|
35
34
|
var import_Features = require("./lib/controller/Features.js");
|
|
36
35
|
__reExport(Controller_exports, require("./lib/controller/Inclusion.js"), module.exports);
|
|
37
|
-
var import_Types = require("./lib/controller/_Types.js");
|
|
38
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
39
37
|
0 && (module.exports = {
|
|
40
|
-
ControllerFirmwareUpdateStatus,
|
|
41
38
|
ProtocolDataRate,
|
|
42
39
|
RFRegion,
|
|
43
40
|
RssiError,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Controller.ts"],
|
|
4
|
-
"sourcesContent": ["export type {\n\tControllerLogContext,\n\tControllerNodeLogContext,\n\tControllerSelfLogContext,\n\tControllerValueLogContext,\n} from \"@zwave-js/core\";\nexport {\n\tProtocolDataRate,\n\tRFRegion,\n\tRssiError,\n\tisRssiError,\n} from \"@zwave-js/core/safe\";\nexport type { RSSI, TXReport } from \"@zwave-js/core/safe\";\nexport type { ZWaveApiVersion, ZWaveLibraryTypes } from \"@zwave-js/core/safe\";\nexport { SerialAPISetupCommand } from \"@zwave-js/serial/serialapi\";\nexport { ZWaveController } from \"./lib/controller/Controller.js\";\nexport type { ControllerEvents } from \"./lib/controller/Controller.js\";\nexport type { ControllerStatistics } from \"./lib/controller/ControllerStatistics.js\";\nexport { ZWaveFeature } from \"./lib/controller/Features.js\";\nexport * from \"./lib/controller/Inclusion.js\";\nexport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAMA
|
|
4
|
+
"sourcesContent": ["export type {\n\tControllerLogContext,\n\tControllerNodeLogContext,\n\tControllerSelfLogContext,\n\tControllerValueLogContext,\n} from \"@zwave-js/core\";\nexport {\n\tProtocolDataRate,\n\tRFRegion,\n\tRssiError,\n\tisRssiError,\n} from \"@zwave-js/core/safe\";\nexport type { RSSI, TXReport } from \"@zwave-js/core/safe\";\nexport type { ZWaveApiVersion, ZWaveLibraryTypes } from \"@zwave-js/core/safe\";\nexport { SerialAPISetupCommand } from \"@zwave-js/serial/serialapi\";\nexport { ZWaveController } from \"./lib/controller/Controller.js\";\nexport type { ControllerEvents } from \"./lib/controller/Controller.js\";\nexport type { ControllerStatistics } from \"./lib/controller/ControllerStatistics.js\";\nexport { ZWaveFeature } from \"./lib/controller/Features.js\";\nexport * from \"./lib/controller/Inclusion.js\";\nexport type {\n\tFirmwareUpdateDeviceID,\n\tFirmwareUpdateFileInfo,\n\tFirmwareUpdateInfo,\n\tGetFirmwareUpdatesOptions,\n\tRebuildRoutesOptions,\n\tRebuildRoutesStatus,\n\tSDKVersion,\n} from \"./lib/controller/_Types.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAMA;;;;;;;;;;;AAAA,kBAKO;AAGP,uBAAsC;AACtC,wBAAgC;AAGhC,sBAA6B;AAC7B,+BAAc,0CAbd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,6 +4,5 @@ export type { ZWaveLibraryTypes } from "@zwave-js/core/safe";
|
|
|
4
4
|
export type { ControllerStatistics } from "./lib/controller/ControllerStatistics.js";
|
|
5
5
|
export { ZWaveFeature } from "./lib/controller/Features.js";
|
|
6
6
|
export * from "./lib/controller/Inclusion.js";
|
|
7
|
-
export {
|
|
8
|
-
export type { ControllerFirmwareUpdateProgress, ControllerFirmwareUpdateResult, FirmwareUpdateDeviceID, GetFirmwareUpdatesOptions, RebuildRoutesOptions, RebuildRoutesStatus, SDKVersion, } from "./lib/controller/_Types.js";
|
|
7
|
+
export type { FirmwareUpdateDeviceID, GetFirmwareUpdatesOptions, RebuildRoutesOptions, RebuildRoutesStatus, SDKVersion, } from "./lib/controller/_Types.js";
|
|
9
8
|
//# sourceMappingURL=Controller_safe.d.ts.map
|
|
@@ -19,7 +19,6 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var Controller_safe_exports = {};
|
|
21
21
|
__export(Controller_safe_exports, {
|
|
22
|
-
ControllerFirmwareUpdateStatus: () => import_Types.ControllerFirmwareUpdateStatus,
|
|
23
22
|
ProtocolDataRate: () => import_safe.ProtocolDataRate,
|
|
24
23
|
RFRegion: () => import_safe.RFRegion,
|
|
25
24
|
RssiError: () => import_safe.RssiError,
|
|
@@ -30,10 +29,8 @@ module.exports = __toCommonJS(Controller_safe_exports);
|
|
|
30
29
|
var import_safe = require("@zwave-js/core/safe");
|
|
31
30
|
var import_Features = require("./lib/controller/Features.js");
|
|
32
31
|
__reExport(Controller_safe_exports, require("./lib/controller/Inclusion.js"), module.exports);
|
|
33
|
-
var import_Types = require("./lib/controller/_Types.js");
|
|
34
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
33
|
0 && (module.exports = {
|
|
36
|
-
ControllerFirmwareUpdateStatus,
|
|
37
34
|
ProtocolDataRate,
|
|
38
35
|
RFRegion,
|
|
39
36
|
RssiError,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Controller_safe.ts"],
|
|
4
|
-
"sourcesContent": ["export {\n\tProtocolDataRate,\n\tRFRegion,\n\tRssiError,\n\tisRssiError,\n} from \"@zwave-js/core/safe\";\nexport type { RSSI, TXReport } from \"@zwave-js/core/safe\";\nexport type { ZWaveLibraryTypes } from \"@zwave-js/core/safe\";\nexport type { ControllerStatistics } from \"./lib/controller/ControllerStatistics.js\";\nexport { ZWaveFeature } from \"./lib/controller/Features.js\";\nexport * from \"./lib/controller/Inclusion.js\";\nexport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA
|
|
4
|
+
"sourcesContent": ["export {\n\tProtocolDataRate,\n\tRFRegion,\n\tRssiError,\n\tisRssiError,\n} from \"@zwave-js/core/safe\";\nexport type { RSSI, TXReport } from \"@zwave-js/core/safe\";\nexport type { ZWaveLibraryTypes } from \"@zwave-js/core/safe\";\nexport type { ControllerStatistics } from \"./lib/controller/ControllerStatistics.js\";\nexport { ZWaveFeature } from \"./lib/controller/Features.js\";\nexport * from \"./lib/controller/Inclusion.js\";\nexport type {\n\tFirmwareUpdateDeviceID,\n\tGetFirmwareUpdatesOptions,\n\tRebuildRoutesOptions,\n\tRebuildRoutesStatus,\n\tSDKVersion,\n} from \"./lib/controller/_Types.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;AAAA,kBAKO;AAIP,sBAA6B;AAC7B,oCAAc,0CAVd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/cjs/Driver.d.ts
CHANGED
|
@@ -7,5 +7,7 @@ export { type CommandRequest, type ContainsCC, type ContainsSerializedCC, type M
|
|
|
7
7
|
export { Driver, libName, libVersion } from "./lib/driver/Driver.js";
|
|
8
8
|
export * from "./lib/driver/DriverMode.js";
|
|
9
9
|
export type { EditableZWaveOptions, PartialZWaveOptions, ZWaveOptions, } from "./lib/driver/ZWaveOptions.js";
|
|
10
|
+
export { OTWFirmwareUpdateStatus } from "./lib/driver/_Types.js";
|
|
11
|
+
export type { OTWFirmwareUpdateProgress, OTWFirmwareUpdateResult, } from "./lib/driver/_Types.js";
|
|
10
12
|
export type { DriverLogContext } from "./lib/log/Driver.js";
|
|
11
13
|
//# sourceMappingURL=Driver.d.ts.map
|
package/build/cjs/Driver.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(Driver_exports, {
|
|
|
24
24
|
Message: () => import_serial.Message,
|
|
25
25
|
MessagePriority: () => import_core.MessagePriority,
|
|
26
26
|
MessageType: () => import_serial.MessageType,
|
|
27
|
+
OTWFirmwareUpdateStatus: () => import_Types.OTWFirmwareUpdateStatus,
|
|
27
28
|
containsCC: () => import_serialapi.containsCC,
|
|
28
29
|
containsSerializedCC: () => import_serialapi.containsSerializedCC,
|
|
29
30
|
isCommandRequest: () => import_serialapi.isCommandRequest,
|
|
@@ -37,6 +38,7 @@ var import_serial = require("@zwave-js/serial");
|
|
|
37
38
|
var import_serialapi = require("@zwave-js/serial/serialapi");
|
|
38
39
|
var import_Driver = require("./lib/driver/Driver.js");
|
|
39
40
|
__reExport(Driver_exports, require("./lib/driver/DriverMode.js"), module.exports);
|
|
41
|
+
var import_Types = require("./lib/driver/_Types.js");
|
|
40
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
43
|
0 && (module.exports = {
|
|
42
44
|
Driver,
|
|
@@ -44,6 +46,7 @@ __reExport(Driver_exports, require("./lib/driver/DriverMode.js"), module.exports
|
|
|
44
46
|
Message,
|
|
45
47
|
MessagePriority,
|
|
46
48
|
MessageType,
|
|
49
|
+
OTWFirmwareUpdateStatus,
|
|
47
50
|
containsCC,
|
|
48
51
|
containsSerializedCC,
|
|
49
52
|
isCommandRequest,
|
package/build/cjs/Driver.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Driver.ts"],
|
|
4
|
-
"sourcesContent": ["export { MessagePriority } from \"@zwave-js/core\";\nexport type { SendMessageOptions } from \"@zwave-js/core\";\nexport type { FileSystem } from \"@zwave-js/core\";\nexport { FunctionType, Message, MessageType } from \"@zwave-js/serial\";\nexport type {\n\tMessageOptions,\n\tResponsePredicate,\n\tResponseRole,\n} from \"@zwave-js/serial\";\nexport {\n\ttype CommandRequest,\n\ttype ContainsCC,\n\ttype ContainsSerializedCC,\n\ttype MessageWithCC,\n\tcontainsCC,\n\tcontainsSerializedCC,\n\tisCommandRequest,\n\tisMessageWithCC,\n} from \"@zwave-js/serial/serialapi\";\nexport { Driver, libName, libVersion } from \"./lib/driver/Driver.js\";\nexport * from \"./lib/driver/DriverMode.js\";\nexport type {\n\tEditableZWaveOptions,\n\tPartialZWaveOptions,\n\tZWaveOptions,\n} from \"./lib/driver/ZWaveOptions.js\";\nexport type { DriverLogContext } from \"./lib/log/Driver.js\";\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA
|
|
4
|
+
"sourcesContent": ["export { MessagePriority } from \"@zwave-js/core\";\nexport type { SendMessageOptions } from \"@zwave-js/core\";\nexport type { FileSystem } from \"@zwave-js/core\";\nexport { FunctionType, Message, MessageType } from \"@zwave-js/serial\";\nexport type {\n\tMessageOptions,\n\tResponsePredicate,\n\tResponseRole,\n} from \"@zwave-js/serial\";\nexport {\n\ttype CommandRequest,\n\ttype ContainsCC,\n\ttype ContainsSerializedCC,\n\ttype MessageWithCC,\n\tcontainsCC,\n\tcontainsSerializedCC,\n\tisCommandRequest,\n\tisMessageWithCC,\n} from \"@zwave-js/serial/serialapi\";\nexport { Driver, libName, libVersion } from \"./lib/driver/Driver.js\";\nexport * from \"./lib/driver/DriverMode.js\";\nexport type {\n\tEditableZWaveOptions,\n\tPartialZWaveOptions,\n\tZWaveOptions,\n} from \"./lib/driver/ZWaveOptions.js\";\nexport { OTWFirmwareUpdateStatus } from \"./lib/driver/_Types.js\";\nexport type {\n\tOTWFirmwareUpdateProgress,\n\tOTWFirmwareUpdateResult,\n} from \"./lib/driver/_Types.js\";\nexport type { DriverLogContext } from \"./lib/log/Driver.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAAA,kBAAgC;AAGhC,oBAAmD;AAMnD,uBASO;AACP,oBAA4C;AAC5C,2BAAc,uCApBd;AA0BA,mBAAwC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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.0.0-beta.
|
|
25
|
+
const PACKAGE_VERSION = "15.0.0-beta.2";
|
|
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.0.0-beta.
|
|
4
|
+
"sourcesContent": ["// This file is auto-generated by the codegen maintenance script\nexport const PACKAGE_VERSION = \"15.0.0-beta.2\";\nexport const PACKAGE_NAME = \"zwave-js\";\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;;;;;;AACO,MAAM,kBAAkB;AACxB,MAAM,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -13,7 +13,7 @@ import { type LifelineRoutes } from "../node/_Types.js";
|
|
|
13
13
|
import { type ControllerStatistics, ControllerStatisticsHost } from "./ControllerStatistics.js";
|
|
14
14
|
import { ZWaveFeature } from "./Features.js";
|
|
15
15
|
import { type ExclusionOptions, type FoundNode, type InclusionOptions, type InclusionResult, InclusionState, InclusionStrategy, type JoinNetworkOptions, JoinNetworkResult, LeaveNetworkResult, type PlannedProvisioningEntry, RemoveNodeReason, type ReplaceNodeOptions, type SmartStartProvisioningEntry } from "./Inclusion.js";
|
|
16
|
-
import { type
|
|
16
|
+
import { type FirmwareUpdateInfo, type GetFirmwareUpdatesOptions, type RebuildRoutesOptions, type RebuildRoutesStatus, type SDKVersion } from "./_Types.js";
|
|
17
17
|
interface ControllerEventCallbacks extends StatisticsEventCallbacks<ControllerStatistics> {
|
|
18
18
|
"inclusion failed": () => void;
|
|
19
19
|
"exclusion failed": () => void;
|
|
@@ -32,8 +32,6 @@ interface ControllerEventCallbacks extends StatisticsEventCallbacks<ControllerSt
|
|
|
32
32
|
"leaving network failed": () => void;
|
|
33
33
|
"rebuild routes progress": (progress: ReadonlyMap<number, RebuildRoutesStatus>) => void;
|
|
34
34
|
"rebuild routes done": (result: ReadonlyMap<number, RebuildRoutesStatus>) => void;
|
|
35
|
-
"firmware update progress": (progress: ControllerFirmwareUpdateProgress) => void;
|
|
36
|
-
"firmware update finished": (result: ControllerFirmwareUpdateResult) => void;
|
|
37
35
|
identify: (node: ZWaveNode) => void;
|
|
38
36
|
"status changed": (status: ControllerStatus) => void;
|
|
39
37
|
}
|
|
@@ -608,18 +606,6 @@ export declare class ZWaveController extends TypedEventTarget<ControllerEventCal
|
|
|
608
606
|
private _nvm;
|
|
609
607
|
/** Provides access to the controller's non-volatile memory */
|
|
610
608
|
get nvm(): NVMAdapter;
|
|
611
|
-
/**
|
|
612
|
-
* **Z-Wave 500 series only**
|
|
613
|
-
*
|
|
614
|
-
* Initialize the Firmware Update functionality and determine if the firmware can be updated.
|
|
615
|
-
*/
|
|
616
|
-
private firmwareUpdateNVMInit;
|
|
617
|
-
/**
|
|
618
|
-
* **Z-Wave 500 series only**
|
|
619
|
-
*
|
|
620
|
-
* Set the NEWIMAGE marker in the NVM (to the given value), which is used to signal that a new firmware image is present
|
|
621
|
-
*/
|
|
622
|
-
private firmwareUpdateNVMSetNewImage;
|
|
623
609
|
/**
|
|
624
610
|
* **Z-Wave 500 series only**
|
|
625
611
|
*
|
|
@@ -632,18 +618,6 @@ export declare class ZWaveController extends TypedEventTarget<ControllerEventCal
|
|
|
632
618
|
* Calculates the CRC-16 for the specified block of data in the NVM
|
|
633
619
|
*/
|
|
634
620
|
private firmwareUpdateNVMUpdateCRC16;
|
|
635
|
-
/**
|
|
636
|
-
* **Z-Wave 500 series only**
|
|
637
|
-
*
|
|
638
|
-
* Writes the given data into the firmware update region of the NVM.
|
|
639
|
-
*/
|
|
640
|
-
private firmwareUpdateNVMWrite;
|
|
641
|
-
/**
|
|
642
|
-
* **Z-Wave 500 series only**
|
|
643
|
-
*
|
|
644
|
-
* Checks if the firmware present in the NVM is valid
|
|
645
|
-
*/
|
|
646
|
-
private firmwareUpdateNVMIsValidCRC16;
|
|
647
621
|
/**
|
|
648
622
|
* **Z-Wave 500 series only**
|
|
649
623
|
*
|
|
@@ -833,22 +807,6 @@ export declare class ZWaveController extends TypedEventTarget<ControllerEventCal
|
|
|
833
807
|
* **WARNING:** This method will throw instead of returning `false` if invalid arguments are passed or downloading files or starting an update fails.
|
|
834
808
|
*/
|
|
835
809
|
firmwareUpdateOTA(nodeId: number, updateInfo: FirmwareUpdateInfo, options?: FirmwareUpdateOptions): Promise<FirmwareUpdateResult>;
|
|
836
|
-
private _firmwareUpdateInProgress;
|
|
837
|
-
/**
|
|
838
|
-
* Returns whether a firmware update is in progress for the controller.
|
|
839
|
-
*/
|
|
840
|
-
isFirmwareUpdateInProgress(): boolean;
|
|
841
|
-
/**
|
|
842
|
-
* Updates the firmware of the controller using the given firmware file.
|
|
843
|
-
*
|
|
844
|
-
* The return value indicates whether the update was successful.
|
|
845
|
-
* **WARNING:** After a successful update, the Z-Wave driver will destroy itself so it can be restarted.
|
|
846
|
-
*
|
|
847
|
-
* **WARNING:** A failure during this process may put your controller in recovery mode, rendering it unusable until a correct firmware image is uploaded. Use at your own risk!
|
|
848
|
-
*/
|
|
849
|
-
firmwareUpdateOTW(data: Uint8Array): Promise<ControllerFirmwareUpdateResult>;
|
|
850
|
-
private firmwareUpdateOTW500;
|
|
851
|
-
private firmwareUpdateOTW700;
|
|
852
810
|
private _currentLearnMode;
|
|
853
811
|
private _joinNetworkOptions;
|
|
854
812
|
beginJoiningNetwork(options?: JoinNetworkOptions): Promise<JoinNetworkResult>;
|
|
@@ -73,9 +73,7 @@ var import_shared = require("@zwave-js/shared");
|
|
|
73
73
|
var import_arrays = require("alcalzone-shared/arrays");
|
|
74
74
|
var import_async = require("alcalzone-shared/async");
|
|
75
75
|
var import_deferred_promise = require("alcalzone-shared/deferred-promise");
|
|
76
|
-
var import_math = require("alcalzone-shared/math");
|
|
77
76
|
var import_typeguards = require("alcalzone-shared/typeguards");
|
|
78
|
-
var import_DriverMode = require("../driver/DriverMode.js");
|
|
79
77
|
var import_NetworkCache = require("../driver/NetworkCache.js");
|
|
80
78
|
var import_Task = require("../driver/Task.js");
|
|
81
79
|
var import_DeviceClass = require("../node/DeviceClass.js");
|
|
@@ -90,7 +88,6 @@ var import_NVMIO = require("./NVMIO.js");
|
|
|
90
88
|
var import_NodeInformationFrame = require("./NodeInformationFrame.js");
|
|
91
89
|
var import_ProxyInclusionMachine = require("./ProxyInclusionMachine.js");
|
|
92
90
|
var import_ZWaveSDKVersions = require("./ZWaveSDKVersions.js");
|
|
93
|
-
var import_Types2 = require("./_Types.js");
|
|
94
91
|
var import_utils = require("./utils.js");
|
|
95
92
|
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
96
93
|
function accept(f) {
|
|
@@ -152,21 +149,20 @@ let ZWaveController = (() => {
|
|
|
152
149
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
153
150
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
154
151
|
}
|
|
155
|
-
driver;
|
|
156
152
|
/** @internal */
|
|
157
|
-
constructor(driver
|
|
153
|
+
constructor(driver) {
|
|
158
154
|
super();
|
|
155
|
+
debugger;
|
|
159
156
|
this.driver = driver;
|
|
160
157
|
this._nodes = (0, import_shared.createThrowingMap)((nodeId) => {
|
|
161
158
|
throw new import_core.ZWaveError(`Node ${nodeId} was not found!`, import_core.ZWaveErrorCodes.Controller_NodeNotFound, nodeId);
|
|
162
159
|
});
|
|
163
|
-
if (bootloaderOnly)
|
|
164
|
-
return;
|
|
165
160
|
driver.registerRequestHandler(import_serial.FunctionType.AddNodeToNetwork, this.handleAddNodeStatusReport.bind(this));
|
|
166
161
|
driver.registerRequestHandler(import_serial.FunctionType.RemoveNodeFromNetwork, this.handleRemoveNodeStatusReport.bind(this));
|
|
167
162
|
driver.registerRequestHandler(import_serial.FunctionType.ReplaceFailedNode, this.handleReplaceNodeStatusReport.bind(this));
|
|
168
163
|
driver.registerRequestHandler(import_serial.FunctionType.SetLearnMode, this.handleLearnModeCallback.bind(this));
|
|
169
164
|
}
|
|
165
|
+
driver;
|
|
170
166
|
_type;
|
|
171
167
|
get type() {
|
|
172
168
|
return this._type;
|
|
@@ -4014,6 +4010,7 @@ let ZWaveController = (() => {
|
|
|
4014
4010
|
* **Z-Wave 500 series only**
|
|
4015
4011
|
*
|
|
4016
4012
|
* Initialize the Firmware Update functionality and determine if the firmware can be updated.
|
|
4013
|
+
* @internal
|
|
4017
4014
|
*/
|
|
4018
4015
|
async firmwareUpdateNVMInit() {
|
|
4019
4016
|
const ret = await this.driver.sendMessage(new import_serialapi41.FirmwareUpdateNVM_InitRequest());
|
|
@@ -4023,6 +4020,7 @@ let ZWaveController = (() => {
|
|
|
4023
4020
|
* **Z-Wave 500 series only**
|
|
4024
4021
|
*
|
|
4025
4022
|
* Set the NEWIMAGE marker in the NVM (to the given value), which is used to signal that a new firmware image is present
|
|
4023
|
+
* @internal
|
|
4026
4024
|
*/
|
|
4027
4025
|
async firmwareUpdateNVMSetNewImage(value = true) {
|
|
4028
4026
|
await this.driver.sendMessage(new import_serialapi41.FirmwareUpdateNVM_SetNewImageRequest({
|
|
@@ -4055,6 +4053,7 @@ let ZWaveController = (() => {
|
|
|
4055
4053
|
* **Z-Wave 500 series only**
|
|
4056
4054
|
*
|
|
4057
4055
|
* Writes the given data into the firmware update region of the NVM.
|
|
4056
|
+
* @internal
|
|
4058
4057
|
*/
|
|
4059
4058
|
async firmwareUpdateNVMWrite(offset, buffer) {
|
|
4060
4059
|
await this.driver.sendMessage(new import_serialapi41.FirmwareUpdateNVM_WriteRequest({
|
|
@@ -4066,6 +4065,7 @@ let ZWaveController = (() => {
|
|
|
4066
4065
|
* **Z-Wave 500 series only**
|
|
4067
4066
|
*
|
|
4068
4067
|
* Checks if the firmware present in the NVM is valid
|
|
4068
|
+
* @internal
|
|
4069
4069
|
*/
|
|
4070
4070
|
async firmwareUpdateNVMIsValidCRC16() {
|
|
4071
4071
|
const ret = await this.driver.sendMessage(new import_serialapi41.FirmwareUpdateNVM_IsValidCRC16Request());
|
|
@@ -4653,7 +4653,7 @@ let ZWaveController = (() => {
|
|
|
4653
4653
|
this.driver.controllerLog.print(message, "error");
|
|
4654
4654
|
throw new import_core.ZWaveError(message, import_core.ZWaveErrorCodes.FirmwareUpdateCC_NetworkBusy);
|
|
4655
4655
|
}
|
|
4656
|
-
if (this.
|
|
4656
|
+
if (this.driver.isOTWFirmwareUpdateInProgress()) {
|
|
4657
4657
|
const message = `Failed to start the update: The controller is currently being updated!`;
|
|
4658
4658
|
this.driver.controllerLog.print(message, "error");
|
|
4659
4659
|
throw new import_core.ZWaveError(message, import_core.ZWaveErrorCodes.FirmwareUpdateCC_NetworkBusy);
|
|
@@ -4706,215 +4706,6 @@ let ZWaveController = (() => {
|
|
|
4706
4706
|
}
|
|
4707
4707
|
return node.updateFirmware(firmwares, options);
|
|
4708
4708
|
}
|
|
4709
|
-
_firmwareUpdateInProgress = false;
|
|
4710
|
-
/**
|
|
4711
|
-
* Returns whether a firmware update is in progress for the controller.
|
|
4712
|
-
*/
|
|
4713
|
-
isFirmwareUpdateInProgress() {
|
|
4714
|
-
return this._firmwareUpdateInProgress;
|
|
4715
|
-
}
|
|
4716
|
-
/**
|
|
4717
|
-
* Updates the firmware of the controller using the given firmware file.
|
|
4718
|
-
*
|
|
4719
|
-
* The return value indicates whether the update was successful.
|
|
4720
|
-
* **WARNING:** After a successful update, the Z-Wave driver will destroy itself so it can be restarted.
|
|
4721
|
-
*
|
|
4722
|
-
* **WARNING:** A failure during this process may put your controller in recovery mode, rendering it unusable until a correct firmware image is uploaded. Use at your own risk!
|
|
4723
|
-
*/
|
|
4724
|
-
async firmwareUpdateOTW(data) {
|
|
4725
|
-
if (this.isAnyOTAFirmwareUpdateInProgress()) {
|
|
4726
|
-
const message = `Failed to start the update: A firmware update is already in progress on this network!`;
|
|
4727
|
-
this.driver.controllerLog.print(message, "error");
|
|
4728
|
-
throw new import_core.ZWaveError(message, import_core.ZWaveErrorCodes.OTW_Update_Busy);
|
|
4729
|
-
}
|
|
4730
|
-
if (this.isFirmwareUpdateInProgress()) {
|
|
4731
|
-
const message = `Failed to start the update: The controller is currently being updated!`;
|
|
4732
|
-
this.driver.controllerLog.print(message, "error");
|
|
4733
|
-
throw new import_core.ZWaveError(message, import_core.ZWaveErrorCodes.OTW_Update_Busy);
|
|
4734
|
-
}
|
|
4735
|
-
if (this.driver.mode === import_DriverMode.DriverMode.Bootloader || this.sdkVersionGte("7.0")) {
|
|
4736
|
-
return this.firmwareUpdateOTW700(data);
|
|
4737
|
-
} else if (this.sdkVersionGte("6.50.0") && this.supportedFunctionTypes?.includes(import_serial.FunctionType.FirmwareUpdateNVM)) {
|
|
4738
|
-
const wasUpdated = await this.firmwareUpdateOTW500(data);
|
|
4739
|
-
if (wasUpdated.success) {
|
|
4740
|
-
await this.driver.softResetAndRestart("Activating new firmware and restarting driver...", "Controller firmware updates require a driver restart!");
|
|
4741
|
-
}
|
|
4742
|
-
return wasUpdated;
|
|
4743
|
-
} else {
|
|
4744
|
-
throw new import_core.ZWaveError(`Firmware updates are not supported on this controller`, import_core.ZWaveErrorCodes.Controller_NotSupported);
|
|
4745
|
-
}
|
|
4746
|
-
}
|
|
4747
|
-
async firmwareUpdateOTW500(data) {
|
|
4748
|
-
this._firmwareUpdateInProgress = true;
|
|
4749
|
-
let turnedRadioOff = false;
|
|
4750
|
-
try {
|
|
4751
|
-
this.driver.controllerLog.print("Beginning firmware update");
|
|
4752
|
-
const canUpdate = await this.firmwareUpdateNVMInit();
|
|
4753
|
-
if (!canUpdate) {
|
|
4754
|
-
this.driver.controllerLog.print("OTW update failed: This controller does not support firmware updates", "error");
|
|
4755
|
-
const result2 = {
|
|
4756
|
-
success: false,
|
|
4757
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.Error_NotSupported
|
|
4758
|
-
};
|
|
4759
|
-
this.emit("firmware update finished", result2);
|
|
4760
|
-
return result2;
|
|
4761
|
-
}
|
|
4762
|
-
await this.toggleRF(false);
|
|
4763
|
-
turnedRadioOff = true;
|
|
4764
|
-
const BLOCK_SIZE = 64;
|
|
4765
|
-
const numFragments = Math.ceil(data.length / BLOCK_SIZE);
|
|
4766
|
-
for (let fragment = 0; fragment < numFragments; fragment++) {
|
|
4767
|
-
const fragmentData = data.subarray(fragment * BLOCK_SIZE, (fragment + 1) * BLOCK_SIZE);
|
|
4768
|
-
await this.firmwareUpdateNVMWrite(fragment * BLOCK_SIZE, fragmentData);
|
|
4769
|
-
const progress = {
|
|
4770
|
-
sentFragments: fragment,
|
|
4771
|
-
totalFragments: numFragments,
|
|
4772
|
-
progress: (0, import_math.roundTo)(fragment / numFragments * 100, 2)
|
|
4773
|
-
};
|
|
4774
|
-
this.emit("firmware update progress", progress);
|
|
4775
|
-
}
|
|
4776
|
-
const isValidCRC = await this.firmwareUpdateNVMIsValidCRC16();
|
|
4777
|
-
if (!isValidCRC) {
|
|
4778
|
-
this.driver.controllerLog.print("OTW update failed: The firmware image is invalid", "error");
|
|
4779
|
-
const result2 = {
|
|
4780
|
-
success: false,
|
|
4781
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.Error_Aborted
|
|
4782
|
-
};
|
|
4783
|
-
this.emit("firmware update finished", result2);
|
|
4784
|
-
return result2;
|
|
4785
|
-
}
|
|
4786
|
-
this.emit("firmware update progress", {
|
|
4787
|
-
sentFragments: numFragments,
|
|
4788
|
-
totalFragments: numFragments,
|
|
4789
|
-
progress: 100
|
|
4790
|
-
});
|
|
4791
|
-
await this.firmwareUpdateNVMSetNewImage();
|
|
4792
|
-
this.driver.controllerLog.print("Firmware update succeeded");
|
|
4793
|
-
const result = {
|
|
4794
|
-
success: true,
|
|
4795
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.OK
|
|
4796
|
-
};
|
|
4797
|
-
this.emit("firmware update finished", result);
|
|
4798
|
-
return result;
|
|
4799
|
-
} finally {
|
|
4800
|
-
this._firmwareUpdateInProgress = false;
|
|
4801
|
-
if (turnedRadioOff)
|
|
4802
|
-
await this.toggleRF(true);
|
|
4803
|
-
}
|
|
4804
|
-
}
|
|
4805
|
-
async firmwareUpdateOTW700(data) {
|
|
4806
|
-
this._firmwareUpdateInProgress = true;
|
|
4807
|
-
let destroy = false;
|
|
4808
|
-
try {
|
|
4809
|
-
await this.driver.enterBootloader();
|
|
4810
|
-
this.driver.controllerLog.print("Beginning firmware upload");
|
|
4811
|
-
await this.driver.bootloader.beginUpload();
|
|
4812
|
-
try {
|
|
4813
|
-
await this.driver.waitForBootloaderChunk((c) => c.type === import_serial.BootloaderChunkType.Message && c.message === "begin upload", 5e3);
|
|
4814
|
-
await this.driver.waitForBootloaderChunk((c) => c.type === import_serial.BootloaderChunkType.FlowControl && c.command === import_serial.XModemMessageHeaders.C, 1e3);
|
|
4815
|
-
} catch {
|
|
4816
|
-
this.driver.controllerLog.print("OTW update failed: Expected response not received from the bootloader", "error");
|
|
4817
|
-
const result2 = {
|
|
4818
|
-
success: false,
|
|
4819
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.Error_Timeout
|
|
4820
|
-
};
|
|
4821
|
-
this.emit("firmware update finished", result2);
|
|
4822
|
-
return result2;
|
|
4823
|
-
}
|
|
4824
|
-
const BLOCK_SIZE = 128;
|
|
4825
|
-
if (data.length % BLOCK_SIZE !== 0) {
|
|
4826
|
-
data = import_shared.Bytes.concat([
|
|
4827
|
-
data,
|
|
4828
|
-
new import_shared.Bytes(BLOCK_SIZE - data.length % BLOCK_SIZE).fill(255)
|
|
4829
|
-
]);
|
|
4830
|
-
}
|
|
4831
|
-
const numFragments = Math.ceil(data.length / BLOCK_SIZE);
|
|
4832
|
-
let aborted = false;
|
|
4833
|
-
transfer: for (let fragment = 1; fragment <= numFragments; fragment++) {
|
|
4834
|
-
const fragmentData = data.subarray((fragment - 1) * BLOCK_SIZE, fragment * BLOCK_SIZE);
|
|
4835
|
-
retry: for (let retry = 0; retry < 3; retry++) {
|
|
4836
|
-
await this.driver.bootloader.uploadFragment(fragment, fragmentData);
|
|
4837
|
-
let result3;
|
|
4838
|
-
try {
|
|
4839
|
-
result3 = await this.driver.waitForBootloaderChunk((c) => c.type === import_serial.BootloaderChunkType.FlowControl, 1e3);
|
|
4840
|
-
} catch {
|
|
4841
|
-
this.driver.controllerLog.print("OTW update failed: The bootloader did not acknowledge the start of transfer.", "error");
|
|
4842
|
-
const result4 = {
|
|
4843
|
-
success: false,
|
|
4844
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.Error_Timeout
|
|
4845
|
-
};
|
|
4846
|
-
this.emit("firmware update finished", result4);
|
|
4847
|
-
return result4;
|
|
4848
|
-
}
|
|
4849
|
-
switch (result3.command) {
|
|
4850
|
-
case import_serial.XModemMessageHeaders.ACK: {
|
|
4851
|
-
const progress = {
|
|
4852
|
-
sentFragments: fragment,
|
|
4853
|
-
totalFragments: numFragments,
|
|
4854
|
-
progress: (0, import_math.roundTo)(fragment / numFragments * 100, 2)
|
|
4855
|
-
};
|
|
4856
|
-
this.emit("firmware update progress", progress);
|
|
4857
|
-
destroy = true;
|
|
4858
|
-
continue transfer;
|
|
4859
|
-
}
|
|
4860
|
-
case import_serial.XModemMessageHeaders.NAK:
|
|
4861
|
-
continue retry;
|
|
4862
|
-
case import_serial.XModemMessageHeaders.CAN:
|
|
4863
|
-
aborted = true;
|
|
4864
|
-
break transfer;
|
|
4865
|
-
}
|
|
4866
|
-
}
|
|
4867
|
-
this.driver.controllerLog.print("OTW update failed: Maximum retry attempts reached", "error");
|
|
4868
|
-
const result2 = {
|
|
4869
|
-
success: false,
|
|
4870
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.Error_RetryLimitReached
|
|
4871
|
-
};
|
|
4872
|
-
this.emit("firmware update finished", result2);
|
|
4873
|
-
return result2;
|
|
4874
|
-
}
|
|
4875
|
-
if (aborted) {
|
|
4876
|
-
const error = await this.driver.waitForBootloaderChunk((c) => c.type === import_serial.BootloaderChunkType.Message && c.message.includes("error 0x"), 1e3).catch(() => void 0);
|
|
4877
|
-
await this.driver.waitForBootloaderChunk((c) => c.type === import_serial.BootloaderChunkType.Menu, 1e3).catch(() => void 0);
|
|
4878
|
-
let message = `OTW update was aborted by the bootloader.`;
|
|
4879
|
-
if (error) {
|
|
4880
|
-
message += ` ${error.message}`;
|
|
4881
|
-
}
|
|
4882
|
-
this.driver.controllerLog.print(message, "error");
|
|
4883
|
-
const result2 = {
|
|
4884
|
-
success: false,
|
|
4885
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.Error_Aborted
|
|
4886
|
-
};
|
|
4887
|
-
this.emit("firmware update finished", result2);
|
|
4888
|
-
return result2;
|
|
4889
|
-
} else {
|
|
4890
|
-
await this.driver.bootloader.finishUpload();
|
|
4891
|
-
try {
|
|
4892
|
-
await Promise.all([
|
|
4893
|
-
this.driver.waitForBootloaderChunk((c) => c.type === import_serial.BootloaderChunkType.Message && c.message.includes("upload complete"), 1e3),
|
|
4894
|
-
this.driver.waitForBootloaderChunk((c) => c.type === import_serial.BootloaderChunkType.Menu, 1e3)
|
|
4895
|
-
]);
|
|
4896
|
-
} catch {
|
|
4897
|
-
this.driver.controllerLog.print("OTW update failed: The bootloader did not acknowledge the end of transfer.", "error");
|
|
4898
|
-
const result2 = {
|
|
4899
|
-
success: false,
|
|
4900
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.Error_Timeout
|
|
4901
|
-
};
|
|
4902
|
-
this.emit("firmware update finished", result2);
|
|
4903
|
-
return result2;
|
|
4904
|
-
}
|
|
4905
|
-
}
|
|
4906
|
-
this.driver.controllerLog.print("Firmware update succeeded");
|
|
4907
|
-
const result = {
|
|
4908
|
-
success: true,
|
|
4909
|
-
status: import_Types2.ControllerFirmwareUpdateStatus.OK
|
|
4910
|
-
};
|
|
4911
|
-
this.emit("firmware update finished", result);
|
|
4912
|
-
return result;
|
|
4913
|
-
} finally {
|
|
4914
|
-
await this.driver.leaveBootloader(destroy);
|
|
4915
|
-
this._firmwareUpdateInProgress = false;
|
|
4916
|
-
}
|
|
4917
|
-
}
|
|
4918
4709
|
_currentLearnMode;
|
|
4919
4710
|
_joinNetworkOptions;
|
|
4920
4711
|
async beginJoiningNetwork(options) {
|