isy-nodejs 1.0.1-alpha.4 → 1.0.1-alpha.6
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/cjs/Devices/Insteon/InsteonFanDevice.js +1 -1
- package/dist/cjs/Devices/Insteon/InsteonFanDevice.js.map +1 -1
- package/dist/cjs/Devices/Insteon/InsteonRelayDevice.js +3 -9
- package/dist/cjs/Devices/Insteon/InsteonRelayDevice.js.map +1 -1
- package/dist/cjs/Devices/Insteon/RelayLampSwitch.js +72 -0
- package/dist/cjs/Devices/Insteon/RelayLampSwitch.js.map +1 -0
- package/dist/cjs/ISY.js +13 -8
- package/dist/cjs/ISY.js.map +1 -1
- package/dist/cjs/ISYNode.js +1 -1
- package/dist/cjs/ISYNode.js.map +1 -1
- package/dist/cjs/ISYScene.js +1 -1
- package/dist/cjs/ISYScene.js.map +1 -1
- package/dist/cjs/Matter/Behaviors/ISYBridgedDeviceBehavior.js.map +1 -1
- package/dist/cjs/Matter/Server/Server.js +1 -1
- package/dist/cjs/Matter/Server/Server.js.map +1 -1
- package/dist/cjs/types/Devices/Insteon/InsteonRelayDevice.d.ts +2 -4
- package/dist/cjs/types/Devices/Insteon/InsteonRelayDevice.d.ts.map +1 -1
- package/dist/cjs/types/Devices/Insteon/RelayLampSwitch.d.ts +93 -0
- package/dist/cjs/types/Devices/Insteon/RelayLampSwitch.d.ts.map +1 -0
- package/dist/cjs/types/ISY.d.ts.map +1 -1
- package/dist/cjs/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts.map +1 -1
- package/dist/cjs/types/Matter/Server/Server.d.ts.map +1 -1
- package/dist/esm/Devices/Brultech/index.js +4 -0
- package/dist/esm/Devices/Brultech/index.js.map +1 -0
- package/dist/esm/Devices/Constructor.js +2 -0
- package/dist/esm/Devices/Constructor.js.map +1 -0
- package/dist/esm/Devices/DeviceFactory.js +13 -0
- package/dist/esm/Devices/DeviceFactory.js.map +1 -0
- package/dist/esm/Devices/DeviceMap.js +4 -0
- package/dist/esm/Devices/DeviceMap.js.map +1 -0
- package/dist/esm/Devices/Elk/ElkAlarmPanelDevice.js +181 -0
- package/dist/esm/Devices/Elk/ElkAlarmPanelDevice.js.map +1 -0
- package/dist/esm/Devices/Elk/ElkAlarmSensorDevice.js +107 -0
- package/dist/esm/Devices/Elk/ElkAlarmSensorDevice.js.map +1 -0
- package/dist/esm/Devices/EndpointFor.js +31 -0
- package/dist/esm/Devices/EndpointFor.js.map +1 -0
- package/dist/esm/Devices/ISYDevice.js +35 -0
- package/dist/esm/Devices/ISYDevice.js.map +1 -0
- package/dist/esm/Devices/ISYDeviceNode.js +62 -0
- package/dist/esm/Devices/ISYDeviceNode.js.map +1 -0
- package/dist/esm/Devices/ISYMultiNodeDevice.js +89 -0
- package/dist/esm/Devices/ISYMultiNodeDevice.js.map +1 -0
- package/dist/esm/Devices/Insteon/Generated/RelayLampSwitch.js +68 -0
- package/dist/esm/Devices/Insteon/Generated/RelayLampSwitch.js.map +1 -0
- package/dist/esm/Devices/Insteon/InsteonBallastDimmerDevice.js +8 -0
- package/dist/esm/Devices/Insteon/InsteonBallastDimmerDevice.js.map +1 -0
- package/dist/esm/Devices/Insteon/InsteonDimmerOutletDevice.js +7 -0
- package/dist/esm/Devices/Insteon/InsteonDimmerOutletDevice.js.map +1 -0
- package/dist/esm/Devices/Insteon/InsteonDimmerSwitchDevice.js +8 -0
- package/dist/esm/Devices/Insteon/InsteonDimmerSwitchDevice.js.map +1 -0
- package/dist/esm/Devices/Insteon/InsteonFanDevice.js +1 -1
- package/dist/esm/Devices/Insteon/InsteonFanDevice.js.map +1 -1
- package/dist/esm/Devices/Insteon/InsteonKeypadDimmerDevice.js +8 -0
- package/dist/esm/Devices/Insteon/InsteonKeypadDimmerDevice.js.map +1 -0
- package/dist/esm/Devices/Insteon/InsteonRelayDevice.js +3 -9
- package/dist/esm/Devices/Insteon/InsteonRelayDevice.js.map +1 -1
- package/dist/esm/Devices/Insteon/RelayLampSwitch.js +68 -0
- package/dist/esm/Devices/Insteon/RelayLampSwitch.js.map +1 -0
- package/dist/esm/Devices/Lutron/index.js +4 -0
- package/dist/esm/Devices/Lutron/index.js.map +1 -0
- package/dist/esm/Devices/MapsTo.js +2 -0
- package/dist/esm/Devices/MapsTo.js.map +1 -0
- package/dist/esm/Devices/NCD/index.js +4 -0
- package/dist/esm/Devices/NCD/index.js.map +1 -0
- package/dist/esm/Devices/NodeFactory.js +48 -0
- package/dist/esm/Devices/NodeFactory.js.map +1 -0
- package/dist/esm/Devices/Poly/index.js +4 -0
- package/dist/esm/Devices/Poly/index.js.map +1 -0
- package/dist/esm/Devices/Scene/index.js +4 -0
- package/dist/esm/Devices/Scene/index.js.map +1 -0
- package/dist/esm/Devices/UDI/index.js +4 -0
- package/dist/esm/Devices/UDI/index.js.map +1 -0
- package/dist/esm/Devices/ZWave/ZWaveBaseDevice.js +38 -0
- package/dist/esm/Devices/ZWave/ZWaveBaseDevice.js.map +1 -0
- package/dist/esm/Devices/ZWave/ZWaveDimmerSwitchDevice.js +8 -0
- package/dist/esm/Devices/ZWave/ZWaveDimmerSwitchDevice.js.map +1 -0
- package/dist/esm/Devices/ZWave/ZWaveLockDevice.js +35 -0
- package/dist/esm/Devices/ZWave/ZWaveLockDevice.js.map +1 -0
- package/dist/esm/Devices/ZWave/index.js +20 -0
- package/dist/esm/Devices/ZWave/index.js.map +1 -0
- package/dist/esm/Devices/index.js +9 -0
- package/dist/esm/Devices/index.js.map +1 -0
- package/dist/esm/ISY.js +13 -8
- package/dist/esm/ISY.js.map +1 -1
- package/dist/esm/ISYNode.js +1 -1
- package/dist/esm/ISYNode.js.map +1 -1
- package/dist/esm/ISYScene.js +1 -1
- package/dist/esm/ISYScene.js.map +1 -1
- package/dist/esm/Matter/Behaviors/ISYBridgedDeviceBehavior.js.map +1 -1
- package/dist/esm/Matter/Server/Server.js +1 -1
- package/dist/esm/Matter/Server/Server.js.map +1 -1
- package/dist/esm/types/Devices/EndpointFor.d.ts +1 -1
- package/dist/esm/types/Devices/Insteon/Generated/RelayLampSwitch.d.ts +93 -0
- package/dist/esm/types/Devices/Insteon/Generated/RelayLampSwitch.d.ts.map +1 -0
- package/dist/esm/types/Devices/Insteon/InsteonDevice.d.ts +2 -2
- package/dist/esm/types/Devices/Insteon/InsteonRelayDevice.d.ts +2 -4
- package/dist/esm/types/Devices/Insteon/InsteonRelayDevice.d.ts.map +1 -1
- package/dist/esm/types/Devices/Insteon/RelayLampSwitch.d.ts +93 -0
- package/dist/esm/types/Devices/Insteon/RelayLampSwitch.d.ts.map +1 -0
- package/dist/esm/types/ISY.d.ts.map +1 -1
- package/dist/esm/types/ISYNode.d.ts +1 -1
- package/dist/esm/types/ISYNode.d.ts.map +1 -1
- package/dist/esm/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts.map +1 -1
- package/dist/esm/types/Matter/Server/Server.d.ts.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/src/Devices/Insteon/InsteonFanDevice.ts +1 -1
- package/src/Devices/Insteon/InsteonRelayDevice.ts +3 -6
- package/src/Devices/Insteon/RelayLampSwitch.ts +131 -0
- package/src/ISY.ts +11 -7
- package/src/ISYNode.ts +1 -1
- package/src/ISYScene.ts +1 -1
- package/src/Matter/Behaviors/ISYBridgedDeviceBehavior.ts +1 -1
- package/src/Matter/Server/Server.ts +6 -2
- package/src/Model/ClassDefinition.ts +1 -1
- package/tsconfig.json +2 -2
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.1-alpha.
|
|
5
|
+
"version": "1.0.1-alpha.6",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Pradeep Mouli"
|
|
8
8
|
},
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@types/node": "^22.7.5",
|
|
47
47
|
"@types/xml2js": "",
|
|
48
48
|
"@types/xmldoc": "",
|
|
49
|
+
"microdiff": "^1.4.0",
|
|
49
50
|
"mocha": "",
|
|
50
51
|
"rimraf": "^6.0.1"
|
|
51
52
|
},
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"axios": "^1.7.7",
|
|
57
58
|
"fast-xml-parser": "^4.5.0",
|
|
58
59
|
"faye-websocket": "^0.11.4",
|
|
60
|
+
"install": "^0.13.0",
|
|
59
61
|
"mocha": "^10.7.3",
|
|
60
62
|
"p-queue": "^8.0.1",
|
|
61
63
|
"winston": "^3.15.0",
|
|
@@ -71,5 +73,5 @@
|
|
|
71
73
|
"publishConfig": {
|
|
72
74
|
"access": "public"
|
|
73
75
|
},
|
|
74
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "960151429615c48f5774a0911ca58885a39e55b4"
|
|
75
77
|
}
|
|
@@ -43,7 +43,7 @@ export class InsteonFanDevice extends InsteonBaseDevice {
|
|
|
43
43
|
constructor(isy: ISY, deviceNode: NodeInfo) {
|
|
44
44
|
super(isy, deviceNode);
|
|
45
45
|
this.light = new InsteonDimmableDevice(isy, deviceNode);
|
|
46
|
-
this.light.events.on('PropertyChanged', ((a: any, b: any, c: any, d: string) => { this.emit('PropertyChanged', `light.${a}`, b, c, d); }).bind(this))
|
|
46
|
+
/*this.light.events.on('PropertyChanged', ((a: any, b: any, c: any, d: string) => { this.emit('PropertyChanged', `light.${a}`, b, c, d); }).bind(this));*/
|
|
47
47
|
this.addChild(this.light);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -7,6 +7,7 @@ import { InsteonBaseDevice } from './InsteonBaseDevice.js';
|
|
|
7
7
|
|
|
8
8
|
import type { OnOffBehavior } from '@project-chip/matter.js/behaviors/on-off';
|
|
9
9
|
import 'winston';
|
|
10
|
+
import { RelayLampSwitch } from './RelayLampSwitch.js';
|
|
10
11
|
import type { Command } from '../../Definitions/Global/Commands.js';
|
|
11
12
|
import { Driver, DriverType } from '../../Definitions/Global/Drivers.js';
|
|
12
13
|
import { UnitOfMeasure } from '../../Definitions/index.js';
|
|
@@ -14,15 +15,11 @@ import { Properties } from '../../ISYConstants.js';
|
|
|
14
15
|
|
|
15
16
|
import type { DriverState } from '../../Model/DriverState.js';
|
|
16
17
|
|
|
17
|
-
export class InsteonRelayDevice extends InsteonBaseDevice<Driver.Signatures<'ST' | 'OL' | 'RR' | 'ERR'>, Command.Signatures<'DON' | 'DOF'
|
|
18
|
+
export class InsteonRelayDevice extends RelayLampSwitch.Node /*InsteonBaseDevice<Driver.Signatures<'ST' | 'OL' | 'RR' | 'ERR'>, Command.Signatures<'DON' | 'DOF'>>*/ {
|
|
18
19
|
// #region Constructors (1)
|
|
19
20
|
|
|
20
21
|
constructor(isy: ISY, nodeInfo: NodeInfo) {
|
|
21
22
|
super(isy, nodeInfo);
|
|
22
|
-
this.drivers.ST = Driver.create('ST', this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Percent, label: 'Status', name: 'status' });
|
|
23
|
-
this.drivers.OL = Driver.create('OL', this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Percent, label: 'On Level', name: 'onLevel' });
|
|
24
|
-
this.drivers.RR = Driver.create('RR', this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Index, label: 'Ramp Rate', name: 'rampRate' });
|
|
25
|
-
this.drivers.ERR = Driver.create('ERR', this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Index, label: 'Error', name: 'error' });
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
// #endregion Constructors (1)
|
|
@@ -58,7 +55,7 @@ export class InsteonRelayDevice extends InsteonBaseDevice<Driver.Signatures<'ST'
|
|
|
58
55
|
|
|
59
56
|
} */
|
|
60
57
|
public override async sendBeep(level: number = 100): Promise<any> {
|
|
61
|
-
return super.
|
|
58
|
+
return super.beep(level);
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
// #endregion Public Methods (2)
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT DIRECTLY. */
|
|
2
|
+
|
|
3
|
+
import { UnitOfMeasure } from "../../Definitions/Global/UOM.js";
|
|
4
|
+
import { Family } from "../../Definitions/Global/Families.js";
|
|
5
|
+
import type { NodeInfo } from "../../Model/NodeInfo.js";
|
|
6
|
+
import type { ISY } from "../../ISY.js";
|
|
7
|
+
import type { ISYNode } from "../../ISYNode.js";
|
|
8
|
+
import { InsteonBaseDevice } from "./InsteonBaseDevice.js";
|
|
9
|
+
import { ISYDeviceNode } from "../ISYDeviceNode.js";
|
|
10
|
+
import { Driver } from "../../Definitions/Global/Drivers.js";
|
|
11
|
+
import { Insteon } from "../../Definitions/index.js";
|
|
12
|
+
import type { DriverState } from "../../Model/DriverState.js";
|
|
13
|
+
import { NodeFactory } from "../NodeFactory.js";
|
|
14
|
+
|
|
15
|
+
export const nodeDefId = "RelayLampSwitch";
|
|
16
|
+
|
|
17
|
+
type Commands = RelayLampSwitch.Commands;
|
|
18
|
+
type Drivers = RelayLampSwitch.Drivers;
|
|
19
|
+
|
|
20
|
+
export class RelayLampSwitchNode extends InsteonBaseDevice<Drivers, Commands> implements RelayLampSwitch.Interface {
|
|
21
|
+
public override readonly commands = {
|
|
22
|
+
DON: this.on,
|
|
23
|
+
DOF: this.off,
|
|
24
|
+
DFOF: this.fastOff,
|
|
25
|
+
DFON: this.fastOn,
|
|
26
|
+
QUERY: this.query,
|
|
27
|
+
BEEP: this.beep,
|
|
28
|
+
BL: this.backlight,
|
|
29
|
+
WDU: this.writeChanges
|
|
30
|
+
};
|
|
31
|
+
static override nodeDefId = 'RelayLampSwitch';
|
|
32
|
+
declare readonly nodeDefId: 'RelayLampSwitch';
|
|
33
|
+
constructor(isy: ISY, nodeInfo: NodeInfo) {
|
|
34
|
+
super(isy, nodeInfo);
|
|
35
|
+
this.drivers.ST = Driver.create('ST', this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Percent, label: 'Status', name: 'status' });
|
|
36
|
+
this.drivers.ERR = Driver.create('ERR', this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Index, label: 'Responding', name: 'responding' });
|
|
37
|
+
}
|
|
38
|
+
async on(value?: 0 | 100) {
|
|
39
|
+
return this.sendCommand('DON', { value: value });
|
|
40
|
+
}
|
|
41
|
+
async off() {
|
|
42
|
+
return this.sendCommand('DOF');
|
|
43
|
+
}
|
|
44
|
+
async fastOff() {
|
|
45
|
+
return this.sendCommand('DFOF');
|
|
46
|
+
}
|
|
47
|
+
async fastOn() {
|
|
48
|
+
return this.sendCommand('DFON');
|
|
49
|
+
}
|
|
50
|
+
async query() {
|
|
51
|
+
return this.sendCommand('QUERY');
|
|
52
|
+
}
|
|
53
|
+
async beep(value?: number) {
|
|
54
|
+
return this.sendCommand('BEEP', { value: value });
|
|
55
|
+
}
|
|
56
|
+
async backlight(value: number) {
|
|
57
|
+
return this.sendCommand('BL', { value: value });
|
|
58
|
+
}
|
|
59
|
+
async writeChanges() {
|
|
60
|
+
return this.sendCommand('WDU');
|
|
61
|
+
}
|
|
62
|
+
public get status(): Insteon.OnLevelRelay {
|
|
63
|
+
return this.drivers.ST?.value;
|
|
64
|
+
}
|
|
65
|
+
public get responding(): Insteon.Error {
|
|
66
|
+
return this.drivers.ERR?.value;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
NodeFactory.register(RelayLampSwitchNode);
|
|
71
|
+
|
|
72
|
+
export namespace RelayLampSwitch {
|
|
73
|
+
export interface Interface extends Omit<InstanceType<typeof RelayLampSwitchNode>, keyof ISYDeviceNode<any, any, any, any>> {
|
|
74
|
+
nodeDefId: "RelayLampSwitch";
|
|
75
|
+
}
|
|
76
|
+
export function is(node: ISYNode<any, any, any, any>): node is RelayLampSwitchNode {
|
|
77
|
+
return node.nodeDefId === nodeDefId;
|
|
78
|
+
}
|
|
79
|
+
export function create(isy: ISY, nodeInfo: NodeInfo) {
|
|
80
|
+
return new RelayLampSwitchNode(isy, nodeInfo);
|
|
81
|
+
}
|
|
82
|
+
export const Node = RelayLampSwitchNode;
|
|
83
|
+
export type Commands = {
|
|
84
|
+
DON: ((value?: (0 | 100)) => Promise<boolean>) & {
|
|
85
|
+
label: "On";
|
|
86
|
+
name: "on";
|
|
87
|
+
};
|
|
88
|
+
DOF: (() => Promise<boolean>) & {
|
|
89
|
+
label: "Off";
|
|
90
|
+
name: "off";
|
|
91
|
+
};
|
|
92
|
+
DFOF: (() => Promise<boolean>) & {
|
|
93
|
+
label: "Fast Off";
|
|
94
|
+
name: "fastOff";
|
|
95
|
+
};
|
|
96
|
+
DFON: (() => Promise<boolean>) & {
|
|
97
|
+
label: "Fast On";
|
|
98
|
+
name: "fastOn";
|
|
99
|
+
};
|
|
100
|
+
QUERY: (() => Promise<boolean>) & {
|
|
101
|
+
label: "Query";
|
|
102
|
+
name: "query";
|
|
103
|
+
};
|
|
104
|
+
BEEP: ((value?: number) => Promise<boolean>) & {
|
|
105
|
+
label: "Beep";
|
|
106
|
+
name: "beep";
|
|
107
|
+
};
|
|
108
|
+
BL: ((value: number) => Promise<boolean>) & {
|
|
109
|
+
label: "Backlight";
|
|
110
|
+
name: "backlight";
|
|
111
|
+
};
|
|
112
|
+
WDU: (() => Promise<boolean>) & {
|
|
113
|
+
label: "Write Changes";
|
|
114
|
+
name: "writeChanges";
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
export type Drivers = {
|
|
118
|
+
ST: {
|
|
119
|
+
uom: UnitOfMeasure.Percent;
|
|
120
|
+
value: Insteon.OnLevelRelay;
|
|
121
|
+
label: "Status";
|
|
122
|
+
name: "status";
|
|
123
|
+
};
|
|
124
|
+
ERR: {
|
|
125
|
+
uom: UnitOfMeasure.Index;
|
|
126
|
+
value: Insteon.Error;
|
|
127
|
+
label: "Responding";
|
|
128
|
+
name: "responding";
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
}
|
package/src/ISY.ts
CHANGED
|
@@ -331,7 +331,11 @@ export class ISY extends EventEmitter implements Disposable {
|
|
|
331
331
|
//
|
|
332
332
|
const impactedDevice = this.getNode(evt.node);
|
|
333
333
|
if (impactedDevice !== undefined && impactedDevice !== null) {
|
|
334
|
-
|
|
334
|
+
try {
|
|
335
|
+
impactedDevice.handleEvent(evt);
|
|
336
|
+
} catch (e) {
|
|
337
|
+
this.logger.error(`Error handling event for ${impactedDevice.name}: ${e.message}`);
|
|
338
|
+
}
|
|
335
339
|
} else {
|
|
336
340
|
this.logger.warn(`${EventType[stringControl]} Event for Unidentified Device: ${JSON.stringify(evt)}`);
|
|
337
341
|
}
|
|
@@ -567,10 +571,10 @@ export class ISY extends EventEmitter implements Disposable {
|
|
|
567
571
|
responseLogLevel?: any;
|
|
568
572
|
} = { trailingSlash: true }
|
|
569
573
|
): Promise<any> {
|
|
570
|
-
const requestLogLevel = options.requestLogLevel ??
|
|
571
|
-
const responseLogLevel = options.responseLogLevel ??
|
|
574
|
+
const requestLogLevel = options.requestLogLevel ?? 'debug';
|
|
575
|
+
const responseLogLevel = options.responseLogLevel ?? 'silly';
|
|
572
576
|
url = `${this.protocol}://${this.address}/rest/${url}${options.trailingSlash ? '/' : ''}`;
|
|
573
|
-
this.logger.log(`Sending request: ${url}
|
|
577
|
+
this.logger.log(requestLogLevel, `Sending request: ${url}`);
|
|
574
578
|
try {
|
|
575
579
|
const response = await axios.get(url, {
|
|
576
580
|
auth: { username: this.credentials.username, password: this.credentials.password }
|
|
@@ -581,13 +585,13 @@ export class ISY extends EventEmitter implements Disposable {
|
|
|
581
585
|
if (options.parserOptions) curParser = new Parser({ ...defaultParserOptions, ...options.parserOptions });
|
|
582
586
|
var altParser = new XMLParser(defaultXMLParserOptions);
|
|
583
587
|
var s = altParser.parse(response.data);
|
|
584
|
-
this.logger.log(
|
|
588
|
+
this.logger.log(requestLogLevel ?? 'debug',`Response: ${JSON.stringify(s)}`);
|
|
585
589
|
return s;
|
|
586
590
|
} else if (response.headers['content-type'].toString().includes('json')) {
|
|
587
|
-
this.logger.log(`Response: ${JSON.stringify(response.data)}
|
|
591
|
+
this.logger.log(responseLogLevel ?? 'debug', `Response: ${JSON.stringify(response.data)}`);
|
|
588
592
|
return JSON.parse(response.data);
|
|
589
593
|
} else {
|
|
590
|
-
this.logger.log(
|
|
594
|
+
this.logger.log(responseLogLevel ?? 'debug',`Response Header: ${JSON.stringify(response.headers)} Response: ${JSON.stringify(response.data)}`);
|
|
591
595
|
return response.data;
|
|
592
596
|
}
|
|
593
597
|
}
|
package/src/ISYNode.ts
CHANGED
|
@@ -253,7 +253,7 @@ export class ISYNode<
|
|
|
253
253
|
} else {
|
|
254
254
|
// this.logger(event.control);
|
|
255
255
|
const e = event.control;
|
|
256
|
-
const dispName = this.commands[e]
|
|
256
|
+
const dispName = this.commands[e]?.name;
|
|
257
257
|
if (dispName !== undefined && dispName !== null) {
|
|
258
258
|
this.logger(`Command ${dispName} (${e}) triggered.`);
|
|
259
259
|
} else {
|
package/src/ISYScene.ts
CHANGED
|
@@ -77,7 +77,7 @@ export class ISYScene extends ISYNode<Family.Scene, Driver.Signatures<'ST'>,Comm
|
|
|
77
77
|
get isOn() {
|
|
78
78
|
for (const device of this.members) {
|
|
79
79
|
if (device instanceof Insteon.Relay) {
|
|
80
|
-
if (device.drivers.ST?.value
|
|
80
|
+
if (device.drivers.ST?.value != 0) {
|
|
81
81
|
return true;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -52,7 +52,7 @@ export class ISYBridgedDeviceBehavior extends Behavior {
|
|
|
52
52
|
this.events.propertyChanged.emit({ driver, newValue, oldValue, formattedValue });
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
[Symbol.asyncDispose]() {
|
|
55
|
+
override [Symbol.asyncDispose]() {
|
|
56
56
|
this.internal.device = null;
|
|
57
57
|
return super[Symbol.asyncDispose]();
|
|
58
58
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NodeJsEnvironment } from '@project-chip/matter-node.js/environment';
|
|
2
2
|
import { StorageBackendDisk } from '@project-chip/matter-node.js/storage';
|
|
3
|
+
import { CommissioningOptions } from '@project-chip/matter.js/behavior/system/commissioning';
|
|
3
4
|
import { BridgedDeviceBasicInformationServer } from '@project-chip/matter.js/behaviors/bridged-device-basic-information';
|
|
4
5
|
import { VendorId } from '@project-chip/matter.js/datatype';
|
|
5
6
|
import { logEndpoint, OnOffBaseDevice } from '@project-chip/matter.js/device';
|
|
@@ -11,7 +12,7 @@ import { AggregatorEndpoint } from '@project-chip/matter.js/endpoints/Aggregator
|
|
|
11
12
|
import { Environment, StorageService } from '@project-chip/matter.js/environment';
|
|
12
13
|
import { Level, levelFromString, Logger as MatterLogger } from '@project-chip/matter.js/log';
|
|
13
14
|
import { ServerNode } from '@project-chip/matter.js/node';
|
|
14
|
-
import { QrCode } from '@project-chip/matter.js/schema';
|
|
15
|
+
import { CommissioningFlowType, QrCode } from '@project-chip/matter.js/schema';
|
|
15
16
|
import { resolve } from 'path';
|
|
16
17
|
import { config } from 'winston';
|
|
17
18
|
import { InsteonDimmableDevice, InsteonKeypadButtonDevice, InsteonRelayDevice, ISY } from '../../ISY.js';
|
|
@@ -70,9 +71,12 @@ export async function createServerNode(isy: ISY = ISY.instance): Promise<ServerN
|
|
|
70
71
|
// Optional when operating only one device on a host, Default port is 5540
|
|
71
72
|
network: {
|
|
72
73
|
port: config.port,
|
|
74
|
+
|
|
73
75
|
//ipv4: false,
|
|
74
76
|
discoveryCapabilities: {
|
|
75
77
|
onIpNetwork: true
|
|
78
|
+
|
|
79
|
+
|
|
76
80
|
}
|
|
77
81
|
},
|
|
78
82
|
|
|
@@ -192,7 +196,7 @@ export async function createServerNode(isy: ISY = ISY.instance): Promise<ServerN
|
|
|
192
196
|
*/
|
|
193
197
|
|
|
194
198
|
logger.info('Bringing server online');
|
|
195
|
-
await server.
|
|
199
|
+
await server.run();
|
|
196
200
|
|
|
197
201
|
logger.info('Matter Server is online');
|
|
198
202
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { camelize, capitalize } from '@project-chip/matter.js/util';
|
|
2
2
|
import camelcase from 'camelcase';
|
|
3
3
|
import { getRandomValues } from 'crypto';
|
|
4
|
-
import { detailedDiff } from 'deep-object-diff';
|
|
4
|
+
//import { detailedDiff } from 'deep-object-diff';
|
|
5
5
|
import { create } from 'domain';
|
|
6
6
|
import * as fs from 'fs';
|
|
7
7
|
import diff from 'microdiff';
|
package/tsconfig.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"noImplicitThis": true,
|
|
16
16
|
"esModuleInterop": true,
|
|
17
17
|
"resolveJsonModule": true,
|
|
18
|
-
"suppressImplicitAnyIndexErrors": true,
|
|
18
|
+
//"suppressImplicitAnyIndexErrors": true,
|
|
19
19
|
"typeRoots": [
|
|
20
20
|
"../../node_modules/@types",
|
|
21
21
|
"types"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"index.js",
|
|
32
32
|
"index.d.ts",
|
|
33
33
|
"src/Definitions/Global/*.ts",
|
|
34
|
-
"src/Devices/Insteon/Generated
|
|
34
|
+
"src/Devices/Insteon/Generated/RelayLampSwitch.ts",
|
|
35
35
|
],
|
|
36
36
|
"exclude": [
|
|
37
37
|
"node_modules/@project-chip/*",
|