isy-nodejs 1.0.2-alpha.0 → 1.0.2-alpha.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/dist/esm/ISY.js +1 -1
- package/dist/esm/ISY.js.map +1 -1
- package/dist/esm/Matter/Behaviors/ISYBridgedDeviceBehavior.js.map +1 -1
- package/dist/esm/Model/ClusterMap.js +2 -2
- package/dist/esm/Model/ClusterMap.js.map +1 -1
- package/dist/esm/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts.map +1 -1
- package/dist/esm/types/Model/ClusterMap.d.ts +2 -2
- package/dist/esm/types/Model/ClusterMap.d.ts.map +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/ISY.ts +1 -1
- package/src/Matter/Behaviors/ISYBridgedDeviceBehavior.ts +5 -1
- package/src/Model/ClusterMap.ts +4 -4
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "isy-nodejs",
|
|
3
3
|
"description": "Node.js wrapper for ISY interface including websockets for change notifications. Fork of isy-js by Rod Toll. Designed to be used in a node.js application.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.0.2-alpha.
|
|
5
|
+
"version": "1.0.2-alpha.2",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Pradeep Mouli"
|
|
8
8
|
},
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@log4js-node/log4js-api": "^1.0.2",
|
|
55
55
|
"@matter/general": "^0.11.4",
|
|
56
|
+
"@matter/main": "^0.11.4",
|
|
56
57
|
"@matter/types": "^0.11.4",
|
|
57
58
|
"@project-chip/matter-node.js": "^0.11.4",
|
|
58
59
|
"@project-chip/matter.js": "^0.11.4",
|
|
@@ -70,5 +71,5 @@
|
|
|
70
71
|
"publishConfig": {
|
|
71
72
|
"access": "public"
|
|
72
73
|
},
|
|
73
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "fac612b29924e40d54cfda336f91c8dc9ba01636"
|
|
74
75
|
}
|
package/src/ISY.ts
CHANGED
|
@@ -750,7 +750,7 @@ export class ISY extends EventEmitter implements Disposable {
|
|
|
750
750
|
//newDevice = new cls(this, nodeInfo) as ISYDeviceNode<any, any, any, any>;
|
|
751
751
|
}
|
|
752
752
|
|
|
753
|
-
if (m) {
|
|
753
|
+
if (m && newDevice) {
|
|
754
754
|
newDevice.productName = m.name;
|
|
755
755
|
newDevice.model = `(${m.modelNumber}) ${m.name} v.${m.version}`;
|
|
756
756
|
newDevice.modelNumber = m.modelNumber;
|
|
@@ -17,6 +17,8 @@ import type { ISYNode } from '../../ISYNode.js';
|
|
|
17
17
|
import type { Family } from '../../Definitions/index.js';
|
|
18
18
|
|
|
19
19
|
|
|
20
|
+
|
|
21
|
+
|
|
20
22
|
type ClusterForBehavior<B extends ClusterBehavior> = B extends ClusterBehavior.Type<infer C> ? C : never;
|
|
21
23
|
export class ISYBridgedDeviceBehavior<N extends ISYNode<any, D, any, any>, D extends ISYNode.DriverSignatures = ISYNode.DriverSignatures> extends Behavior {
|
|
22
24
|
static override readonly id = 'isyNode';
|
|
@@ -33,7 +35,7 @@ export class ISYBridgedDeviceBehavior<N extends ISYNode<any, D, any, any>, D ext
|
|
|
33
35
|
var address = this.state.address;
|
|
34
36
|
const d = ISY.instance.nodeMap.get(this.state.address);
|
|
35
37
|
this.internal.device = d;
|
|
36
|
-
this.internal.map = MappingRegistry.getMapping(this.internal.device as
|
|
38
|
+
this.internal.map = MappingRegistry.getMapping(this.internal.device as ISYNode<Family, any, any, any>);
|
|
37
39
|
|
|
38
40
|
ISY.instance.logger.debug(`Initializing ${this.constructor.name} for ${this.internal.device.constructor.name} ${this.internal.device.name} with address ${address}`);
|
|
39
41
|
if (d) {
|
|
@@ -44,6 +46,8 @@ export class ISYBridgedDeviceBehavior<N extends ISYNode<any, D, any, any>, D ext
|
|
|
44
46
|
let evt = `${d.drivers[f].name}Changed`;
|
|
45
47
|
const obs = Observable<[{ driver: string; newValue: any; oldValue: any; formattedValue: string }]>();
|
|
46
48
|
|
|
49
|
+
|
|
50
|
+
|
|
47
51
|
d.events.on(evt, (driver: string, newValue: any, oldValue: any, formattedValue: string) => obs.emit({ driver, newValue, oldValue, formattedValue }));
|
|
48
52
|
this.events[evt] = obs;
|
|
49
53
|
|
package/src/Model/ClusterMap.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { DriverType } from '../Definitions/Global/Drivers.js';
|
|
|
8
8
|
import { Devices } from '../Devices/index.js';
|
|
9
9
|
import { Insteon } from '../Devices/Insteon/index.js';
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import { CommandsOf, DriversOf, ISYNode } from '../ISYNode.js';
|
|
12
12
|
import { ClusterType } from './ClusterType.js';
|
|
13
13
|
import type { Family } from '../Definitions/index.js';
|
|
14
14
|
|
|
@@ -145,13 +145,13 @@ export class MappingRegistry {
|
|
|
145
145
|
|
|
146
146
|
// #region Public Static Methods (3)
|
|
147
147
|
|
|
148
|
-
public static getMapping<T extends ISYNode<any,
|
|
148
|
+
public static getMapping<T extends ISYNode<any,any,any,any>>(device: ISYNode<any,any,any,any>) {
|
|
149
149
|
if(MappingRegistry.map.has(device.family))
|
|
150
150
|
{
|
|
151
151
|
let g = MappingRegistry.map.get(device.family);
|
|
152
|
-
if(g.has(device.name))
|
|
152
|
+
if(g.has(device.constructor.name))
|
|
153
153
|
{
|
|
154
|
-
return g.get(device.name);
|
|
154
|
+
return g.get(device.constructor.name);
|
|
155
155
|
}
|
|
156
156
|
else if(g.has(device.nodeDefId))
|
|
157
157
|
{
|