isy-nodejs 1.0.1-alpha.3 → 1.0.1-alpha.5

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 (67) hide show
  1. package/dist/cjs/Devices/Insteon/InsteonBaseDevice.js +4 -2
  2. package/dist/cjs/Devices/Insteon/InsteonBaseDevice.js.map +1 -1
  3. package/dist/cjs/Devices/Insteon/InsteonFanDevice.js +2 -0
  4. package/dist/cjs/Devices/Insteon/InsteonFanDevice.js.map +1 -1
  5. package/dist/cjs/Devices/Insteon/InsteonRelayDevice.js +1 -0
  6. package/dist/cjs/Devices/Insteon/InsteonRelayDevice.js.map +1 -1
  7. package/dist/cjs/ISY.js +6 -1
  8. package/dist/cjs/ISY.js.map +1 -1
  9. package/dist/cjs/types/Devices/Insteon/InsteonBaseDevice.d.ts +3 -3
  10. package/dist/cjs/types/Devices/Insteon/InsteonBaseDevice.d.ts.map +1 -1
  11. package/dist/cjs/types/Devices/Insteon/InsteonFanDevice.d.ts +5 -4
  12. package/dist/cjs/types/Devices/Insteon/InsteonFanDevice.d.ts.map +1 -1
  13. package/dist/cjs/types/Devices/Insteon/InsteonRelayDevice.d.ts +1 -1
  14. package/dist/cjs/types/Devices/Insteon/InsteonRelayDevice.d.ts.map +1 -1
  15. package/dist/cjs/types/ISY.d.ts.map +1 -1
  16. package/dist/esm/Devices/Insteon/InsteonBaseDevice.js +49 -0
  17. package/dist/esm/Devices/Insteon/InsteonBaseDevice.js.map +1 -0
  18. package/dist/esm/Devices/Insteon/InsteonCOSensorDevice.js +14 -0
  19. package/dist/esm/Devices/Insteon/InsteonCOSensorDevice.js.map +1 -0
  20. package/dist/esm/Devices/Insteon/InsteonDevice.js +17 -0
  21. package/dist/esm/Devices/Insteon/InsteonDevice.js.map +1 -0
  22. package/dist/esm/Devices/Insteon/InsteonDeviceFactory.js +875 -0
  23. package/dist/esm/Devices/Insteon/InsteonDeviceFactory.js.map +1 -0
  24. package/dist/esm/Devices/Insteon/InsteonDimmableDevice.js +32 -0
  25. package/dist/esm/Devices/Insteon/InsteonDimmableDevice.js.map +1 -0
  26. package/dist/esm/Devices/Insteon/InsteonDoorWindowSensorDevice.js +11 -0
  27. package/dist/esm/Devices/Insteon/InsteonDoorWindowSensorDevice.js.map +1 -0
  28. package/dist/esm/Devices/Insteon/InsteonFanDevice.js +58 -0
  29. package/dist/esm/Devices/Insteon/InsteonFanDevice.js.map +1 -0
  30. package/dist/esm/Devices/Insteon/InsteonKeypadDevice.js +8 -0
  31. package/dist/esm/Devices/Insteon/InsteonKeypadDevice.js.map +1 -0
  32. package/dist/esm/Devices/Insteon/InsteonKeypadRelayDevice.js +8 -0
  33. package/dist/esm/Devices/Insteon/InsteonKeypadRelayDevice.js.map +1 -0
  34. package/dist/esm/Devices/Insteon/InsteonLeakSensorDevice.js +11 -0
  35. package/dist/esm/Devices/Insteon/InsteonLeakSensorDevice.js.map +1 -0
  36. package/dist/esm/Devices/Insteon/InsteonLockDevice.js +32 -0
  37. package/dist/esm/Devices/Insteon/InsteonLockDevice.js.map +1 -0
  38. package/dist/esm/Devices/Insteon/InsteonMotionSensorDevice.js +36 -0
  39. package/dist/esm/Devices/Insteon/InsteonMotionSensorDevice.js.map +1 -0
  40. package/dist/esm/Devices/Insteon/InsteonOnOffOutletDevice.js +19 -0
  41. package/dist/esm/Devices/Insteon/InsteonOnOffOutletDevice.js.map +1 -0
  42. package/dist/esm/Devices/Insteon/InsteonRelayDevice.js +47 -0
  43. package/dist/esm/Devices/Insteon/InsteonRelayDevice.js.map +1 -0
  44. package/dist/esm/Devices/Insteon/InsteonRelaySwitchDevice.js +8 -0
  45. package/dist/esm/Devices/Insteon/InsteonRelaySwitchDevice.js.map +1 -0
  46. package/dist/esm/Devices/Insteon/InsteonSmokeSensorDevice.js +11 -0
  47. package/dist/esm/Devices/Insteon/InsteonSmokeSensorDevice.js.map +1 -0
  48. package/dist/esm/Devices/Insteon/InsteonThermostatDevice.js +30 -0
  49. package/dist/esm/Devices/Insteon/InsteonThermostatDevice.js.map +1 -0
  50. package/dist/esm/Devices/Insteon/index.js +31 -0
  51. package/dist/esm/Devices/Insteon/index.js.map +1 -0
  52. package/dist/esm/ISY.js +6 -1
  53. package/dist/esm/ISY.js.map +1 -1
  54. package/dist/esm/types/Devices/Insteon/InsteonBaseDevice.d.ts +3 -3
  55. package/dist/esm/types/Devices/Insteon/InsteonBaseDevice.d.ts.map +1 -1
  56. package/dist/esm/types/Devices/Insteon/InsteonFanDevice.d.ts +5 -4
  57. package/dist/esm/types/Devices/Insteon/InsteonFanDevice.d.ts.map +1 -1
  58. package/dist/esm/types/Devices/Insteon/InsteonRelayDevice.d.ts +1 -1
  59. package/dist/esm/types/Devices/Insteon/InsteonRelayDevice.d.ts.map +1 -1
  60. package/dist/esm/types/ISY.d.ts.map +1 -1
  61. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  62. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  63. package/package.json +2 -2
  64. package/src/Devices/Insteon/InsteonBaseDevice.ts +9 -8
  65. package/src/Devices/Insteon/InsteonFanDevice.ts +6 -3
  66. package/src/Devices/Insteon/InsteonRelayDevice.ts +2 -1
  67. package/src/ISY.ts +5 -1
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.3",
5
+ "version": "1.0.1-alpha.5",
6
6
  "author": {
7
7
  "name": "Pradeep Mouli"
8
8
  },
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "5671288e3fde06848a4767d39c22b987157fc20a"
74
+ "gitHead": "ce49adae004a6ba0589251732b944a3eb3edc1a2"
75
75
  }
@@ -1,16 +1,17 @@
1
+ import 'winston';
2
+ import { Converters } from '../../Converters.js';
3
+ import type { Command } from '../../Definitions/Global/Commands.js';
4
+ import { Driver, DriverType } from '../../Definitions/Global/Drivers.js';
1
5
  import { Family, Insteon } from '../../Definitions/Global/Families.js';
2
- import { ISY } from '../../ISY.js';
3
6
  import { UnitOfMeasure as UOM, UnitOfMeasure } from '../../Definitions/Global/UOM.js';
4
- import { byteToDegree, byteToPct, pctToByte, type StringKeys } from '../../Utils.js';
7
+ import { ISY } from '../../ISY.js';
8
+ import { ISYNode } from '../../ISYNode.js';
5
9
  import { NodeInfo } from '../../Model/NodeInfo.js';
10
+ import { byteToDegree, byteToPct, pctToByte, type StringKeys } from '../../Utils.js';
6
11
  import { ISYDeviceNode } from '../ISYDeviceNode.js';
7
- import { ISYNode } from '../../ISYNode.js';
8
- import 'winston';
9
- import type { Driver, DriverType } from '../../Definitions/Global/Drivers.js';
10
- import { Converters } from '../../Converters.js';
11
- import type { Command } from '../../Definitions/Global/Commands.js';
12
12
 
13
13
  import type { Merge } from '@project-chip/matter.js/util';
14
+ import type { DriverState } from '../../Model/DriverState.js';
14
15
 
15
16
  // import { InsteonNLS } from './insteonfam.js'
16
17
  export class InsteonBaseDevice<D extends ISYNode.DriverSignatures = {}, C extends ISYNode.CommandSignatures = {}> extends ISYDeviceNode<
@@ -23,7 +24,7 @@ export class InsteonBaseDevice<D extends ISYNode.DriverSignatures = {}, C extend
23
24
  constructor(isy: ISY, deviceNode: NodeInfo) {
24
25
  super(isy, deviceNode);
25
26
  this.family = Family.Insteon;
26
-
27
+ (this.drivers as any).ERR = Driver.create('ERR', this as any, deviceNode.property as DriverState, { uom: UnitOfMeasure.Index, label: 'Responding', name: 'responding' });
27
28
  //// this.productName = InsteonNLS.getDeviceDescription(String.fromCharCode(category,device,version));
28
29
  //his.childDevices = {};
29
30
  }
@@ -5,12 +5,15 @@ import { States } from '../../ISYConstants.js';
5
5
  import { InsteonBaseDevice } from './InsteonBaseDevice.js';
6
6
  import { InsteonDimmableDevice } from './InsteonDimmableDevice.js';
7
7
  import 'winston';
8
- import type { NodeInfo } from '../../Model/NodeInfo.js';
8
+ import type { NodeInfo, StaticNodeInfo } from '../../Model/NodeInfo.js';
9
9
  import {Insteon} from './index.js';
10
+ import { Command, Driver, UnitOfMeasure } from '../../Definitions/index.js';
11
+ import type { DriverState } from '../../Model/DriverState.js';
10
12
 
11
- export class InsteonFanMotorDevice extends InsteonBaseDevice {
12
- constructor (isy: ISY, deviceNode: NodeInfo) {
13
+ export class InsteonFanMotorDevice extends InsteonBaseDevice<Driver.Signatures<'ST'>, Command.Signatures<'DON' | 'DOF'>> {
14
+ constructor (isy: ISY, deviceNode: StaticNodeInfo) {
13
15
  super(isy, deviceNode);
16
+ this.drivers.ST = Driver.create('ST', this, deviceNode.property as DriverState, { uom: UnitOfMeasure.Percent, label: 'Fan Speed (%)', name: 'fanSpeed' });
14
17
  this.hidden = true;
15
18
  }
16
19
 
@@ -14,7 +14,7 @@ import { Properties } from '../../ISYConstants.js';
14
14
 
15
15
  import type { DriverState } from '../../Model/DriverState.js';
16
16
 
17
- export class InsteonRelayDevice extends InsteonBaseDevice<Driver.Signatures<'ST' | 'OL' | 'RR'>, Command.Signatures<'DON' | 'DOF'>> {
17
+ export class InsteonRelayDevice extends InsteonBaseDevice<Driver.Signatures<'ST' | 'OL' | 'RR' | 'ERR'>, Command.Signatures<'DON' | 'DOF'>> {
18
18
  // #region Constructors (1)
19
19
 
20
20
  constructor(isy: ISY, nodeInfo: NodeInfo) {
@@ -22,6 +22,7 @@ export class InsteonRelayDevice extends InsteonBaseDevice<Driver.Signatures<'ST'
22
22
  this.drivers.ST = Driver.create('ST', this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Percent, label: 'Status', name: 'status' });
23
23
  this.drivers.OL = Driver.create('OL', this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Percent, label: 'On Level', name: 'onLevel' });
24
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' });
25
26
  }
26
27
 
27
28
  // #endregion Constructors (1)
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
- impactedDevice.handleEvent(evt);
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
  }