@zwave-js/host 13.10.1 → 14.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ZWaveHost.d.ts +63 -45
- package/build/ZWaveHost.d.ts.map +1 -1
- package/build/mocks.d.ts +9 -13
- package/build/mocks.d.ts.map +1 -1
- package/build/mocks.js +70 -70
- package/build/mocks.js.map +1 -1
- package/package.json +3 -3
package/build/ZWaveHost.d.ts
CHANGED
|
@@ -1,70 +1,88 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { CommandClasses, ControllerLogger,
|
|
3
|
-
import type { ReadonlyThrowingMap } from "@zwave-js/shared";
|
|
1
|
+
import type { DeviceConfig } from "@zwave-js/config";
|
|
2
|
+
import type { CCId, CommandClasses, ControllerLogger, FrameType, MaybeNotKnown, NodeId, SecurityClass, SecurityManagers, SendCommandOptions, SendCommandReturnType, ValueDB, ValueID } from "@zwave-js/core";
|
|
4
3
|
import type { ZWaveHostOptions } from "./ZWaveHostOptions";
|
|
5
|
-
/**
|
|
6
|
-
export interface
|
|
4
|
+
/** Allows querying the home ID and node ID of the host */
|
|
5
|
+
export interface HostIDs {
|
|
7
6
|
/** The ID of this node in the current network */
|
|
8
7
|
ownNodeId: number;
|
|
9
8
|
/** The Home ID of the current network */
|
|
10
9
|
homeId: number;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/** Management of Security S2 keys and nonces (Z-Wave Long Range) */
|
|
18
|
-
securityManagerLR: SecurityManager2 | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Retrieves the maximum version of a command class that can be used to communicate with a node.
|
|
21
|
-
* Returns 1 if the node claims that it does not support a CC.
|
|
22
|
-
* Throws if the CC is not implemented in this library yet.
|
|
23
|
-
*/
|
|
24
|
-
getSafeCCVersion(cc: CommandClasses, nodeId: number, endpointIndex?: number): number;
|
|
10
|
+
}
|
|
11
|
+
/** Allows querying device configuration for a node */
|
|
12
|
+
export interface GetDeviceConfig {
|
|
13
|
+
getDeviceConfig(nodeId: number): DeviceConfig | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface GetSupportedCCVersion {
|
|
25
16
|
/**
|
|
26
17
|
* Retrieves the maximum version of a command class the given node/endpoint has reported support for.
|
|
27
18
|
* Returns 0 when the CC is not supported or that information is not known yet.
|
|
28
19
|
*/
|
|
29
20
|
getSupportedCCVersion(cc: CommandClasses, nodeId: number, endpointIndex?: number): number;
|
|
21
|
+
}
|
|
22
|
+
export interface GetSafeCCVersion {
|
|
30
23
|
/**
|
|
31
|
-
*
|
|
24
|
+
* Retrieves the maximum version of a command class that can be used to communicate with a node.
|
|
25
|
+
* Returns 1 if the node claims that it does not support a CC.
|
|
26
|
+
* Returns `undefined` for CCs that are not implemented in this library yet.
|
|
32
27
|
*/
|
|
33
|
-
|
|
28
|
+
getSafeCCVersion(cc: CommandClasses, nodeId: number, endpointIndex?: number): number | undefined;
|
|
29
|
+
}
|
|
30
|
+
/** Additional context needed for deserializing CCs */
|
|
31
|
+
export interface CCParsingContext extends Readonly<SecurityManagers>, GetDeviceConfig, HostIDs {
|
|
32
|
+
sourceNodeId: number;
|
|
33
|
+
__internalIsMockNode?: boolean;
|
|
34
|
+
/** If known, the frame type of the containing message */
|
|
35
|
+
frameType: FrameType;
|
|
36
|
+
getHighestSecurityClass(nodeId: number): MaybeNotKnown<SecurityClass>;
|
|
37
|
+
hasSecurityClass(nodeId: number, securityClass: SecurityClass): MaybeNotKnown<boolean>;
|
|
38
|
+
setSecurityClass(nodeId: number, securityClass: SecurityClass, granted: boolean): void;
|
|
39
|
+
}
|
|
40
|
+
/** Additional context needed for serializing CCs */
|
|
41
|
+
export interface CCEncodingContext extends Readonly<SecurityManagers>, GetDeviceConfig, HostIDs, GetSupportedCCVersion {
|
|
34
42
|
getHighestSecurityClass(nodeId: number): MaybeNotKnown<SecurityClass>;
|
|
35
43
|
hasSecurityClass(nodeId: number, securityClass: SecurityClass): MaybeNotKnown<boolean>;
|
|
36
44
|
setSecurityClass(nodeId: number, securityClass: SecurityClass, granted: boolean): void;
|
|
37
|
-
/**
|
|
38
|
-
* Returns the next callback ID. Callback IDs are used to correlate requests
|
|
39
|
-
* to the controller/nodes with its response
|
|
40
|
-
*/
|
|
41
|
-
getNextCallbackId(): number;
|
|
42
|
-
/**
|
|
43
|
-
* Returns the next session ID for supervised communication
|
|
44
|
-
*/
|
|
45
|
-
getNextSupervisionSessionId(nodeId: number): number;
|
|
46
|
-
getDeviceConfig?: (nodeId: number) => DeviceConfig | undefined;
|
|
47
|
-
__internalIsMockNode?: boolean;
|
|
48
45
|
}
|
|
49
46
|
/** Host application abstractions that provide support for reading and writing values to a database */
|
|
50
|
-
export interface
|
|
47
|
+
export interface GetValueDB {
|
|
51
48
|
/** Returns the value DB which belongs to the node with the given ID, or throws if the Value DB cannot be accessed */
|
|
52
49
|
getValueDB(nodeId: number): ValueDB;
|
|
53
50
|
/** Returns the value DB which belongs to the node with the given ID, or `undefined` if the Value DB cannot be accessed */
|
|
54
51
|
tryGetValueDB(nodeId: number): ValueDB | undefined;
|
|
55
52
|
}
|
|
56
|
-
/**
|
|
57
|
-
export interface
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
/** Allows accessing a specific node */
|
|
54
|
+
export interface GetNode<T extends NodeId> {
|
|
55
|
+
getNode(nodeId: number): T | undefined;
|
|
56
|
+
getNodeOrThrow(nodeId: number): T;
|
|
57
|
+
}
|
|
58
|
+
/** Allows accessing all nodes */
|
|
59
|
+
export interface GetAllNodes<T extends NodeId> {
|
|
60
|
+
getAllNodes(): T[];
|
|
61
|
+
}
|
|
62
|
+
/** Allows looking up Z-Wave manufacturers by manufacturer ID */
|
|
63
|
+
export interface LookupManufacturer {
|
|
64
|
+
/** Looks up the name of the manufacturer with the given ID in the configuration DB */
|
|
65
|
+
lookupManufacturer(manufacturerId: number): string | undefined;
|
|
66
|
+
}
|
|
67
|
+
/** Allows sending commands to one or more nodes */
|
|
68
|
+
export interface SendCommand {
|
|
69
|
+
sendCommand<TResponse extends CCId | undefined = undefined>(command: CCId, options?: SendCommandOptions): Promise<SendCommandReturnType<TResponse>>;
|
|
70
|
+
}
|
|
71
|
+
/** Allows reading options to use for interviewing devices */
|
|
72
|
+
export interface GetInterviewOptions {
|
|
73
|
+
getInterviewOptions(): ZWaveHostOptions["interview"];
|
|
74
|
+
}
|
|
75
|
+
/** Allows reading user preferences */
|
|
76
|
+
export interface GetUserPreferences {
|
|
77
|
+
getUserPreferences(): ZWaveHostOptions["preferences"];
|
|
78
|
+
}
|
|
79
|
+
/** Allows reading user preferences */
|
|
80
|
+
export interface GetCommunicationTimeouts {
|
|
81
|
+
getCommunicationTimeouts(): ZWaveHostOptions["timeouts"];
|
|
82
|
+
}
|
|
83
|
+
export type LogNode = Pick<ControllerLogger, "logNode">;
|
|
84
|
+
/** Allows scheduling a value refresh (poll) for a later time */
|
|
85
|
+
export interface SchedulePoll {
|
|
68
86
|
schedulePoll(nodeId: number, valueId: ValueID, options: NodeSchedulePollOptions): boolean;
|
|
69
87
|
}
|
|
70
88
|
export interface NodeSchedulePollOptions {
|
package/build/ZWaveHost.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZWaveHost.d.ts","sourceRoot":"","sources":["../src/ZWaveHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ZWaveHost.d.ts","sourceRoot":"","sources":["../src/ZWaveHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EACX,IAAI,EACJ,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,MAAM,EACN,aAAa,EAC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AAW,mBAAmB;IACnC,mBAAmB,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;CACrD;AAED,sCAAsC;AACtC,MAAM,WAAW,kBAAkB;IAClC,kBAAkB,IAAI,gBAAgB,CAAC,aAAa,CAAC,CAAC;CACtD;AAED,sCAAsC;AACtC,MAAM,WAAW,wBAAwB;IACxC,wBAAwB,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC;CACzD;AAED,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;AAExD,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC5B,YAAY,CACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC;CACX;AAED,MAAM,WAAW,uBAAuB;IACvC,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB"}
|
package/build/mocks.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import type { ZWaveApplicationHost, ZWaveHost } from "./ZWaveHost";
|
|
5
|
-
export interface CreateTestingHostOptions {
|
|
6
|
-
homeId: ZWaveHost["homeId"];
|
|
7
|
-
ownNodeId: ZWaveHost["ownNodeId"];
|
|
8
|
-
getSafeCCVersion: ZWaveHost["getSafeCCVersion"];
|
|
9
|
-
getSupportedCCVersion?: ZWaveHost["getSupportedCCVersion"];
|
|
1
|
+
import { type ControlsCC, type EndpointId, type GetEndpoint, type IsCCSecure, type ListenBehavior, type NodeId, type QuerySecurityClasses, type SetSecurityClass, type SupportsCC } from "@zwave-js/core";
|
|
2
|
+
import type { GetAllNodes, GetDeviceConfig, GetNode, GetSupportedCCVersion, GetValueDB, HostIDs, LogNode } from "./ZWaveHost";
|
|
3
|
+
export interface CreateTestingHostOptions extends HostIDs, GetDeviceConfig {
|
|
10
4
|
}
|
|
11
|
-
export type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
export type BaseTestEndpoint = EndpointId & SupportsCC & ControlsCC & IsCCSecure;
|
|
6
|
+
export type BaseTestNode = BaseTestEndpoint & NodeId & ListenBehavior & QuerySecurityClasses & SetSecurityClass & SupportsCC & ControlsCC & IsCCSecure & GetEndpoint<BaseTestEndpoint>;
|
|
7
|
+
export interface TestingHost extends HostIDs, GetValueDB, GetSupportedCCVersion, GetAllNodes<BaseTestNode>, GetNode<BaseTestNode>, GetDeviceConfig, LogNode {
|
|
8
|
+
setNode(nodeId: number, node: BaseTestNode): void;
|
|
9
|
+
}
|
|
10
|
+
/** Creates a {@link TestingHost} that can be used instead of a real driver instance in tests */
|
|
15
11
|
export declare function createTestingHost(options?: Partial<CreateTestingHostOptions>): TestingHost;
|
|
16
12
|
//# sourceMappingURL=mocks.d.ts.map
|
package/build/mocks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAIf,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACX,WAAW,EACX,eAAe,EACf,OAAO,EACP,qBAAqB,EACrB,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,wBAAyB,SAAQ,OAAO,EAAE,eAAe;CAAG;AAE7E,MAAM,MAAM,gBAAgB,GACzB,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEd,MAAM,MAAM,YAAY,GACrB,gBAAgB,GAChB,MAAM,GACN,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAEjC,MAAM,WAAW,WAChB,SACC,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,WAAW,CAAC,YAAY,CAAC,EACzB,OAAO,CAAC,YAAY,CAAC,EACrB,eAAe,EACf,OAAO;IAER,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CAClD;AAED,gGAAgG;AAChG,wBAAgB,iBAAiB,CAChC,OAAO,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAC7C,WAAW,CAsGb"}
|
package/build/mocks.js
CHANGED
|
@@ -1,58 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createTestingHost = createTestingHost;
|
|
4
|
-
/* eslint-disable @typescript-eslint/require-await */
|
|
5
|
-
const config_1 = require("@zwave-js/config");
|
|
6
4
|
const core_1 = require("@zwave-js/core");
|
|
7
5
|
const shared_1 = require("@zwave-js/shared");
|
|
8
|
-
/** Creates a {@link
|
|
6
|
+
/** Creates a {@link TestingHost} that can be used instead of a real driver instance in tests */
|
|
9
7
|
function createTestingHost(options = {}) {
|
|
10
8
|
const valuesStorage = new Map();
|
|
11
9
|
const metadataStorage = new Map();
|
|
12
10
|
const valueDBCache = new Map();
|
|
13
|
-
const
|
|
11
|
+
const nodes = (0, shared_1.createThrowingMap)((nodeId) => {
|
|
12
|
+
throw new core_1.ZWaveError(`Node ${nodeId} was not found!`, core_1.ZWaveErrorCodes.Controller_NodeNotFound);
|
|
13
|
+
});
|
|
14
14
|
const ret = {
|
|
15
15
|
homeId: options.homeId ?? 0x7e570001,
|
|
16
16
|
ownNodeId: options.ownNodeId ?? 1,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
17
|
+
getDeviceConfig: options.getDeviceConfig ?? (() => undefined),
|
|
18
|
+
// securityManager: undefined,
|
|
19
|
+
// securityManager2: undefined,
|
|
20
|
+
// securityManagerLR: undefined,
|
|
21
|
+
// getDeviceConfig: () => undefined,
|
|
22
|
+
// lookupManufacturer: () => undefined,
|
|
23
|
+
logNode: () => { },
|
|
24
|
+
// options: {
|
|
25
|
+
// attempts: {
|
|
26
|
+
// nodeInterview: 1,
|
|
27
|
+
// // openSerialPort: 1,
|
|
28
|
+
// sendData: 3,
|
|
29
|
+
// controller: 3,
|
|
30
|
+
// },
|
|
31
|
+
// timeouts: {
|
|
32
|
+
// refreshValue: 5000,
|
|
33
|
+
// refreshValueAfterTransition: 1000,
|
|
34
|
+
// },
|
|
35
|
+
// },
|
|
36
|
+
// getInterviewOptions() {
|
|
37
|
+
// return {};
|
|
38
|
+
// },
|
|
39
|
+
// getUserPreferences() {
|
|
40
|
+
// return undefined;
|
|
41
|
+
// },
|
|
42
|
+
// getCommunicationTimeouts() {
|
|
43
|
+
// return {
|
|
44
|
+
// refreshValue: 5000,
|
|
45
|
+
// refreshValueAfterTransition: 1000,
|
|
46
|
+
// };
|
|
47
|
+
// },
|
|
48
|
+
getNode(nodeId) {
|
|
49
|
+
return nodes.get(nodeId);
|
|
42
50
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return
|
|
51
|
+
getNodeOrThrow(nodeId) {
|
|
52
|
+
return nodes.getOrThrow(nodeId);
|
|
53
|
+
},
|
|
54
|
+
getAllNodes() {
|
|
55
|
+
return [...nodes.values()];
|
|
56
|
+
},
|
|
57
|
+
setNode(nodeId, node) {
|
|
58
|
+
nodes.set(nodeId, node);
|
|
59
|
+
},
|
|
60
|
+
// getSafeCCVersion: options.getSafeCCVersion ?? (() => 100),
|
|
61
|
+
getSupportedCCVersion: (cc, nodeId, endpoint) => {
|
|
62
|
+
return nodes.get(nodeId)?.getEndpoint(endpoint ?? 0)?.getCCVersion(cc) ?? 0;
|
|
63
|
+
// return options.getSupportedCCVersion?.(cc, nodeId, endpoint)
|
|
64
|
+
// ?? options.getSafeCCVersion?.(cc, nodeId, endpoint)
|
|
65
|
+
// ?? 100;
|
|
56
66
|
},
|
|
57
67
|
getValueDB: (nodeId) => {
|
|
58
68
|
if (!valueDBCache.has(nodeId)) {
|
|
@@ -63,34 +73,24 @@ function createTestingHost(options = {}) {
|
|
|
63
73
|
tryGetValueDB: (nodeId) => {
|
|
64
74
|
return ret.getValueDB(nodeId);
|
|
65
75
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
sendCommand: async (_command, _options) => {
|
|
86
|
-
return undefined;
|
|
87
|
-
},
|
|
88
|
-
waitForCommand: async (_predicate, _timeout) => {
|
|
89
|
-
return undefined;
|
|
90
|
-
},
|
|
91
|
-
schedulePoll: (_nodeId, _valueId, _options) => {
|
|
92
|
-
return false;
|
|
93
|
-
},
|
|
76
|
+
// getHighestSecurityClass: (nodeId) => {
|
|
77
|
+
// const node = nodes.getOrThrow(nodeId);
|
|
78
|
+
// return node.getHighestSecurityClass();
|
|
79
|
+
// },
|
|
80
|
+
// hasSecurityClass: (nodeId, securityClass) => {
|
|
81
|
+
// const node = nodes.getOrThrow(nodeId);
|
|
82
|
+
// return node.hasSecurityClass(securityClass);
|
|
83
|
+
// },
|
|
84
|
+
// setSecurityClass: (nodeId, securityClass, granted) => {
|
|
85
|
+
// const node = nodes.getOrThrow(nodeId);
|
|
86
|
+
// node.setSecurityClass(securityClass, granted);
|
|
87
|
+
// },
|
|
88
|
+
// sendCommand: async (_command, _options) => {
|
|
89
|
+
// return undefined as any;
|
|
90
|
+
// },
|
|
91
|
+
// schedulePoll: (_nodeId, _valueId, _options) => {
|
|
92
|
+
// return false;
|
|
93
|
+
// },
|
|
94
94
|
};
|
|
95
95
|
return ret;
|
|
96
96
|
}
|
package/build/mocks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../src/mocks.ts"],"names":[],"mappings":";;AA0DA,8CAwGC;AAlKD,yCAawB;AACxB,6CAAqD;AA2CrD,gGAAgG;AAChG,SAAgB,iBAAiB,CAChC,UAA6C,EAAE;IAE/C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;IAChC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC;IAClC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAmB,CAAC;IAChD,MAAM,KAAK,GAAG,IAAA,0BAAiB,EAAuB,CAAC,MAAM,EAAE,EAAE;QAChE,MAAM,IAAI,iBAAU,CACnB,QAAQ,MAAM,iBAAiB,EAC/B,sBAAe,CAAC,uBAAuB,CACvC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAgB;QACxB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI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EAAE,EAAE;YACtB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC/B,YAAY,CAAC,GAAG,CACf,MAAM,EACN,IAAI,cAAO,CACV,MAAM,EACN,aAAoB,EACpB,eAAsB,CACtB,CACD,CAAC;YACH,CAAC;YACD,OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;QAClC,CAAC;QACD,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE;YACzB,OAAO,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;QACD,yCAAyC;QACzC,0CAA0C;QAC1C,0CAA0C;QAC1C,KAAK;QACL,iDAAiD;QACjD,0CAA0C;QAC1C,gDAAgD;QAChD,KAAK;QACL,0DAA0D;QAC1D,0CAA0C;QAC1C,kDAAkD;QAClD,KAAK;QACL,+CAA+C;QAC/C,4BAA4B;QAC5B,KAAK;QACL,mDAAmD;QACnD,iBAAiB;QACjB,KAAK;KACL,CAAC;IACF,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zwave-js/host",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0-beta.0",
|
|
4
4
|
"description": "zwave-js: Host abstractions",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"lint:ts:fix": "yarn run lint:ts --fix"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@zwave-js/config": "
|
|
54
|
-
"@zwave-js/core": "
|
|
53
|
+
"@zwave-js/config": "14.0.0-beta.0",
|
|
54
|
+
"@zwave-js/core": "14.0.0-beta.0",
|
|
55
55
|
"@zwave-js/shared": "13.6.0",
|
|
56
56
|
"alcalzone-shared": "^4.0.8"
|
|
57
57
|
},
|