isy-nodejs 0.5.0-beta.55 → 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/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 -282
- 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 -9
- 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 -21
- 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 -41
- 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
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