isy-nodejs 0.5.0-beta.54 → 0.5.0-beta.56
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/lib/Devices/ISYDevice.d.ts +12 -12
- package/lib/Devices/Insteon/InsteonCOSensorDevice.d.ts +5 -5
- package/lib/Devices/Insteon/InsteonDevice.d.ts +136 -10
- package/lib/Devices/Insteon/InsteonDevice.js +10 -11
- package/lib/Devices/Insteon/InsteonDeviceFactory.d.ts +2 -2
- package/lib/Devices/Insteon/InsteonDeviceFactory.js +10 -10
- package/lib/Devices/Insteon/InsteonDimmerSwitchDevice.d.ts +67 -3
- package/lib/Devices/Insteon/InsteonDoorWindowSensorDevice.d.ts +5 -5
- package/lib/Devices/Insteon/InsteonFanDevice.d.ts +5 -5
- package/lib/Devices/Insteon/InsteonLeakSensorDevice.d.ts +5 -5
- package/lib/Devices/Insteon/InsteonLockDevice.d.ts +5 -5
- package/lib/Devices/Insteon/InsteonRelayDevice.d.ts +5 -5
- package/lib/Devices/Insteon/InsteonRelaySwitchDevice.d.ts +67 -3
- package/lib/Devices/Insteon/InsteonSmokeSensorDevice.d.ts +5 -5
- package/lib/ISY.d.ts +1 -0
- package/lib/ISY.js +16 -1
- package/package.json +9 -1
- package/.babelrc +0 -12
- package/.travis.yml +0 -8
- package/ISYNodesDump.json +0 -1368
- package/isySampleOutput/config.json +0 -1825
- package/scratch.js +0 -95
- package/src/Categories.ts +0 -19
- package/src/Devices/DeviceFactory.ts +0 -20
- package/src/Devices/Elk/ElkAlarmPanelDevice.ts +0 -190
- package/src/Devices/Elk/ElkAlarmSensorDevice.ts +0 -104
- package/src/Devices/ISYDevice.ts +0 -281
- package/src/Devices/Insteon/InsteonBallastDimmerDevice.ts +0 -6
- package/src/Devices/Insteon/InsteonBaseDevice.ts +0 -43
- package/src/Devices/Insteon/InsteonCOSensorDevice.ts +0 -12
- package/src/Devices/Insteon/InsteonDeviceFactory.ts +0 -823
- package/src/Devices/Insteon/InsteonDimmableDevice.ts +0 -16
- package/src/Devices/Insteon/InsteonDimmerOutletDevice.ts +0 -7
- package/src/Devices/Insteon/InsteonDimmerSwitchDevice.ts +0 -8
- package/src/Devices/Insteon/InsteonDoorWindowSensorDevice.ts +0 -12
- package/src/Devices/Insteon/InsteonFanDevice.ts +0 -73
- package/src/Devices/Insteon/InsteonKeypadDevice.ts +0 -10
- package/src/Devices/Insteon/InsteonKeypadDimmerDevice.ts +0 -10
- package/src/Devices/Insteon/InsteonKeypadRelayDevice.ts +0 -7
- package/src/Devices/Insteon/InsteonLeakSensorDevice.ts +0 -12
- package/src/Devices/Insteon/InsteonLockDevice.ts +0 -42
- package/src/Devices/Insteon/InsteonMotionSensorDevice.ts +0 -43
- package/src/Devices/Insteon/InsteonOnOffOutletDevice.ts +0 -22
- package/src/Devices/Insteon/InsteonRelayDevice.ts +0 -20
- package/src/Devices/Insteon/InsteonRelaySwitchDevice.ts +0 -8
- package/src/Devices/Insteon/InsteonSmokeSensorDevice.ts +0 -12
- package/src/Devices/Insteon/InsteonThermostatDevice.ts +0 -39
- package/src/Devices/Insteon/insteondevice.ts +0 -47
- package/src/Events/EventType.ts +0 -27
- package/src/Events/ISYEvent.ts +0 -9
- package/src/Events/NodeEvent.ts +0 -9
- package/src/Events/PropertyChangedEvent.ts +0 -11
- package/src/Families.ts +0 -30
- package/src/ISY.ts +0 -768
- package/src/ISYConstants.ts +0 -182
- package/src/ISYNode.ts +0 -195
- package/src/ISYScene.ts +0 -120
- package/src/ISYVariable.ts +0 -49
- package/src/isyproductinfo.json +0 -378
- package/src/utils.ts +0 -108
- package/test/testsuite.js +0 -607
- package/tsconfig.json +0 -27
- package/tslint.json +0 -28
|
@@ -1,9 +1,73 @@
|
|
|
1
|
+
import { InsteonRelayDevice } from './InsteonRelayDevice';
|
|
1
2
|
declare const InsteonRelaySwitchDevice_base: {
|
|
2
|
-
new (
|
|
3
|
+
new (...args: any[]): {
|
|
3
4
|
[x: string]: any;
|
|
5
|
+
convertFrom(value: any, uom: number): any;
|
|
6
|
+
convertTo(value: any, uom: number): any;
|
|
7
|
+
sendBeep(level?: number): Promise<any>;
|
|
8
|
+
family: import("../../Families").Family.Insteon;
|
|
9
|
+
readonly typeCode: string;
|
|
10
|
+
readonly deviceClass: any;
|
|
11
|
+
readonly parentAddress: any;
|
|
12
|
+
readonly category: number;
|
|
13
|
+
readonly subCategory: number;
|
|
14
|
+
readonly type: any;
|
|
15
|
+
_parentDevice: import("../ISYDevice").ISYDevice<import("../../Families").Family.Insteon>;
|
|
16
|
+
readonly children: import("../ISYDevice").ISYDevice<import("../../Families").Family.Insteon>[];
|
|
17
|
+
readonly scenes: import("../../ISYScene").ISYScene[];
|
|
18
|
+
readonly formatted: any;
|
|
19
|
+
readonly uom: any;
|
|
20
|
+
readonly pending: any;
|
|
21
|
+
hidden: boolean;
|
|
22
|
+
location: string;
|
|
23
|
+
addLink(isyScene: import("../../ISYScene").ISYScene): void;
|
|
24
|
+
addChild(childDevice: import("../ISYDevice").ISYDevice<import("../../Families").Family.Insteon>): void;
|
|
25
|
+
readonly parentDevice: import("../ISYDevice").ISYDevice<import("../../Families").Family.Insteon>;
|
|
26
|
+
refreshProperty(propertyName: string): Promise<any>;
|
|
27
|
+
updateProperty(propertyName: string, value: string): Promise<any>;
|
|
28
|
+
sendCommand(command: any, ...parameters: any[]): Promise<any>;
|
|
29
|
+
refresh(): Promise<any>;
|
|
30
|
+
handleControlTrigger(controlName: any): boolean;
|
|
31
|
+
handlePropertyChange(propertyName: string, value: any, formattedValue: string): boolean;
|
|
32
|
+
readonly isy: import("../../ISY").ISY;
|
|
33
|
+
readonly flag: any;
|
|
34
|
+
readonly nodeDefId: string;
|
|
35
|
+
readonly address: string;
|
|
36
|
+
name: string;
|
|
37
|
+
displayName: string;
|
|
38
|
+
spokenName: string;
|
|
39
|
+
isLoad: boolean;
|
|
40
|
+
folder: string;
|
|
41
|
+
parent: any;
|
|
42
|
+
parentType: import("../../ISYConstants").NodeType;
|
|
43
|
+
readonly elkId: string;
|
|
44
|
+
nodeType: number;
|
|
45
|
+
readonly baseDisplayName: string;
|
|
46
|
+
propsInitialized: boolean;
|
|
47
|
+
logger: (msg: any) => void;
|
|
48
|
+
lastChanged: Date;
|
|
49
|
+
enabled: boolean;
|
|
50
|
+
on(event: "PropertyChanged" | "ControlTriggered", listener: ((propertyName: string, newValue: any, oldValue: any, formattedValue: string) => any) | ((controlName: string) => any)): any;
|
|
51
|
+
emit(event: "PropertyChanged" | "ControlTriggered", propertyName?: string, newValue?: any, oldValue?: any, formattedValue?: string, controlName?: string): boolean;
|
|
52
|
+
handleEvent(event: any): boolean;
|
|
53
|
+
setDisplayName(template: string): string;
|
|
54
|
+
refreshNotes(): Promise<void>;
|
|
55
|
+
getNotes(): Promise<any>;
|
|
56
|
+
addListener(event: string | symbol, listener: (...args: any[]) => void): any;
|
|
57
|
+
once(event: string | symbol, listener: (...args: any[]) => void): any;
|
|
58
|
+
prependListener(event: string | symbol, listener: (...args: any[]) => void): any;
|
|
59
|
+
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): any;
|
|
60
|
+
removeListener(event: string | symbol, listener: (...args: any[]) => void): any;
|
|
61
|
+
off(event: string | symbol, listener: (...args: any[]) => void): any;
|
|
62
|
+
removeAllListeners(event?: string | symbol): any;
|
|
63
|
+
setMaxListeners(n: number): any;
|
|
64
|
+
getMaxListeners(): number;
|
|
65
|
+
listeners(event: string | symbol): Function[];
|
|
66
|
+
rawListeners(event: string | symbol): Function[];
|
|
67
|
+
eventNames(): (string | symbol)[];
|
|
68
|
+
listenerCount(type: string | symbol): number;
|
|
4
69
|
};
|
|
5
|
-
|
|
6
|
-
};
|
|
70
|
+
} & typeof InsteonRelayDevice;
|
|
7
71
|
export declare class InsteonRelaySwitchDevice extends InsteonRelaySwitchDevice_base {
|
|
8
72
|
constructor(isy: any, deviceNode: any);
|
|
9
73
|
}
|
|
@@ -4,15 +4,15 @@ declare const InsteonSmokeSensorDevice_base: {
|
|
|
4
4
|
new (...args: any[]): {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
readonly state: boolean;
|
|
7
|
-
family:
|
|
7
|
+
family: import("../../Families").Family;
|
|
8
8
|
readonly typeCode: string;
|
|
9
9
|
readonly deviceClass: any;
|
|
10
10
|
readonly parentAddress: any;
|
|
11
11
|
readonly category: number;
|
|
12
12
|
readonly subCategory: number;
|
|
13
13
|
readonly type: any;
|
|
14
|
-
_parentDevice: import("../ISYDevice").ISYDevice<
|
|
15
|
-
readonly children: import("../ISYDevice").ISYDevice<
|
|
14
|
+
_parentDevice: import("../ISYDevice").ISYDevice<import("../../Families").Family>;
|
|
15
|
+
readonly children: import("../ISYDevice").ISYDevice<import("../../Families").Family>[];
|
|
16
16
|
readonly scenes: import("../../ISYScene").ISYScene[];
|
|
17
17
|
readonly formatted: any;
|
|
18
18
|
readonly uom: any;
|
|
@@ -22,8 +22,8 @@ declare const InsteonSmokeSensorDevice_base: {
|
|
|
22
22
|
convertTo(value: any, uom: number): any;
|
|
23
23
|
convertFrom(value: any, uom: number): any;
|
|
24
24
|
addLink(isyScene: import("../../ISYScene").ISYScene): void;
|
|
25
|
-
addChild(childDevice: import("../ISYDevice").ISYDevice<
|
|
26
|
-
readonly parentDevice: import("../ISYDevice").ISYDevice<
|
|
25
|
+
addChild(childDevice: import("../ISYDevice").ISYDevice<import("../../Families").Family>): void;
|
|
26
|
+
readonly parentDevice: import("../ISYDevice").ISYDevice<import("../../Families").Family>;
|
|
27
27
|
refreshProperty(propertyName: string): Promise<any>;
|
|
28
28
|
updateProperty(propertyName: string, value: string): Promise<any>;
|
|
29
29
|
sendCommand(command: any, ...parameters: any[]): Promise<any>;
|
package/lib/ISY.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ export declare class ISY extends EventEmitter {
|
|
|
110
110
|
data: any;
|
|
111
111
|
}): void;
|
|
112
112
|
initializeWebSocket(): void;
|
|
113
|
+
private closeWebSocket;
|
|
113
114
|
getDevice(address: string, parentsOnly?: boolean): ISYDevice<any>;
|
|
114
115
|
getScene(address: string | number): any;
|
|
115
116
|
sendISYCommand(path: string): Promise<any>;
|
package/lib/ISY.js
CHANGED
|
@@ -530,8 +530,9 @@ class ISY extends events_1.EventEmitter {
|
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
532
|
initializeWebSocket() {
|
|
533
|
+
this.closeWebSocket();
|
|
533
534
|
const that = this;
|
|
534
|
-
const auth = `Basic ${
|
|
535
|
+
const auth = `Basic ${Buffer.from(`${this.credentials.username}:${this.credentials.password}`).toString('base64')}`;
|
|
535
536
|
that.logger(`Connecting to: ${this.wsprotocol}://${this.address}/rest/subscribe`);
|
|
536
537
|
this.webSocket = new faye_websocket_1.Client(`${this.wsprotocol}://${this.address}/rest/subscribe`, ['ISYSUB'], {
|
|
537
538
|
headers: {
|
|
@@ -562,6 +563,20 @@ class ISY extends events_1.EventEmitter {
|
|
|
562
563
|
throw new Error('Timeout contacting ISY');
|
|
563
564
|
});
|
|
564
565
|
}
|
|
566
|
+
closeWebSocket() {
|
|
567
|
+
if (!this.webSocket) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
try {
|
|
571
|
+
this.webSocket.close();
|
|
572
|
+
}
|
|
573
|
+
catch (error) {
|
|
574
|
+
this.logger(`Websocket close failed: ${error}`);
|
|
575
|
+
}
|
|
576
|
+
finally {
|
|
577
|
+
this.webSocket = undefined;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
565
580
|
getDevice(address, parentsOnly = false) {
|
|
566
581
|
let s = this.deviceList.get(address);
|
|
567
582
|
if (!parentsOnly) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "isy-nodejs",
|
|
3
3
|
"description": "Javascript 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": "0.5.0-beta.
|
|
5
|
+
"version": "0.5.0-beta.56",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Rod Toll & Pradeep Mouli",
|
|
8
8
|
"email": "rod_toll@hotmail.com"
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"ZWave"
|
|
20
20
|
],
|
|
21
21
|
"main": "./lib/ISY.js",
|
|
22
|
+
"files": [
|
|
23
|
+
"lib",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
22
27
|
"devDependencies": {
|
|
23
28
|
"@types/node": "^10.17.15",
|
|
24
29
|
"@types/xml2js": "^0.4.5",
|
|
@@ -42,5 +47,8 @@
|
|
|
42
47
|
"repository": {
|
|
43
48
|
"type": "git",
|
|
44
49
|
"url": "https://github.com/pradeepmouli/isy-js.git"
|
|
50
|
+
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": "^22.12.0 || ^24.0.0"
|
|
45
53
|
}
|
|
46
54
|
}
|
package/.babelrc
DELETED