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.
Files changed (49) hide show
  1. package/lib/ISY.d.ts +1 -0
  2. package/lib/ISY.js +16 -1
  3. package/package.json +9 -1
  4. package/.babelrc +0 -12
  5. package/.travis.yml +0 -8
  6. package/ISYNodesDump.json +0 -1368
  7. package/isySampleOutput/config.json +0 -1825
  8. package/scratch.js +0 -95
  9. package/src/Categories.ts +0 -19
  10. package/src/Devices/DeviceFactory.ts +0 -20
  11. package/src/Devices/Elk/ElkAlarmPanelDevice.ts +0 -190
  12. package/src/Devices/Elk/ElkAlarmSensorDevice.ts +0 -104
  13. package/src/Devices/ISYDevice.ts +0 -282
  14. package/src/Devices/Insteon/InsteonBallastDimmerDevice.ts +0 -6
  15. package/src/Devices/Insteon/InsteonBaseDevice.ts +0 -43
  16. package/src/Devices/Insteon/InsteonCOSensorDevice.ts +0 -12
  17. package/src/Devices/Insteon/InsteonDeviceFactory.ts +0 -823
  18. package/src/Devices/Insteon/InsteonDimmableDevice.ts +0 -16
  19. package/src/Devices/Insteon/InsteonDimmerOutletDevice.ts +0 -7
  20. package/src/Devices/Insteon/InsteonDimmerSwitchDevice.ts +0 -8
  21. package/src/Devices/Insteon/InsteonDoorWindowSensorDevice.ts +0 -12
  22. package/src/Devices/Insteon/InsteonFanDevice.ts +0 -73
  23. package/src/Devices/Insteon/InsteonKeypadDevice.ts +0 -9
  24. package/src/Devices/Insteon/InsteonKeypadDimmerDevice.ts +0 -10
  25. package/src/Devices/Insteon/InsteonKeypadRelayDevice.ts +0 -7
  26. package/src/Devices/Insteon/InsteonLeakSensorDevice.ts +0 -12
  27. package/src/Devices/Insteon/InsteonLockDevice.ts +0 -42
  28. package/src/Devices/Insteon/InsteonMotionSensorDevice.ts +0 -43
  29. package/src/Devices/Insteon/InsteonOnOffOutletDevice.ts +0 -22
  30. package/src/Devices/Insteon/InsteonRelayDevice.ts +0 -21
  31. package/src/Devices/Insteon/InsteonRelaySwitchDevice.ts +0 -8
  32. package/src/Devices/Insteon/InsteonSmokeSensorDevice.ts +0 -12
  33. package/src/Devices/Insteon/InsteonThermostatDevice.ts +0 -39
  34. package/src/Devices/Insteon/insteondevice.ts +0 -41
  35. package/src/Events/EventType.ts +0 -27
  36. package/src/Events/ISYEvent.ts +0 -9
  37. package/src/Events/NodeEvent.ts +0 -9
  38. package/src/Events/PropertyChangedEvent.ts +0 -11
  39. package/src/Families.ts +0 -30
  40. package/src/ISY.ts +0 -768
  41. package/src/ISYConstants.ts +0 -182
  42. package/src/ISYNode.ts +0 -195
  43. package/src/ISYScene.ts +0 -120
  44. package/src/ISYVariable.ts +0 -49
  45. package/src/isyproductinfo.json +0 -378
  46. package/src/utils.ts +0 -108
  47. package/test/testsuite.js +0 -607
  48. package/tsconfig.json +0 -27
  49. 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 ${new Buffer(`${this.credentials.username}:${this.credentials.password}`).toString('base64')}`;
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.55",
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
@@ -1,12 +0,0 @@
1
- {
2
-
3
- "plugins": [
4
- "transform-es2015-modules-commonjs"
5
- ],
6
- "ignore": [
7
- "./node_modules",
8
- "./lib",
9
- "./isySampleOutput",
10
- "./test"
11
- ]
12
- }
package/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - "0.10"
4
- before_script:
5
- - cd node_modules/fake-isy-994i
6
- - node start.js &
7
- - cd ../../
8
-