isy-nodejs 1.0.1-alpha.1 → 1.0.1-alpha.10

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 (184) hide show
  1. package/dist/cjs/Converters.js +66 -30
  2. package/dist/cjs/Converters.js.map +1 -1
  3. package/dist/cjs/Definitions/Global/Drivers.js +10 -3
  4. package/dist/cjs/Definitions/Global/Drivers.js.map +1 -1
  5. package/dist/cjs/Definitions/Global/Events.js +1 -2
  6. package/dist/cjs/Definitions/Global/Events.js.map +1 -1
  7. package/dist/cjs/Devices/Elk/ElkAlarmPanelDevice.js +3 -3
  8. package/dist/cjs/Devices/Elk/ElkAlarmSensorDevice.js +9 -6
  9. package/dist/cjs/Devices/Elk/ElkAlarmSensorDevice.js.map +1 -1
  10. package/dist/cjs/Devices/Insteon/InsteonBaseDevice.js +5 -3
  11. package/dist/cjs/Devices/Insteon/InsteonBaseDevice.js.map +1 -1
  12. package/dist/cjs/Devices/Insteon/InsteonFanDevice.js +7 -3
  13. package/dist/cjs/Devices/Insteon/InsteonFanDevice.js.map +1 -1
  14. package/dist/cjs/Devices/Insteon/InsteonMotionSensorDevice.js +5 -5
  15. package/dist/cjs/Devices/Insteon/InsteonRelayDevice.js +3 -8
  16. package/dist/cjs/Devices/Insteon/InsteonRelayDevice.js.map +1 -1
  17. package/dist/cjs/Devices/Insteon/RelayLampSwitch.js +72 -0
  18. package/dist/cjs/Devices/Insteon/RelayLampSwitch.js.map +1 -0
  19. package/dist/cjs/ISY.js +155 -135
  20. package/dist/cjs/ISY.js.map +1 -1
  21. package/dist/cjs/ISYNode.js +34 -15
  22. package/dist/cjs/ISYNode.js.map +1 -1
  23. package/dist/cjs/ISYScene.js +3 -3
  24. package/dist/cjs/ISYScene.js.map +1 -1
  25. package/dist/cjs/Matter/Behaviors/ISYBridgedDeviceBehavior.js +11 -4
  26. package/dist/cjs/Matter/Behaviors/ISYBridgedDeviceBehavior.js.map +1 -1
  27. package/dist/cjs/Matter/Behaviors/ISYClusterBehavior.js +26 -7
  28. package/dist/cjs/Matter/Behaviors/ISYClusterBehavior.js.map +1 -1
  29. package/dist/cjs/Matter/Behaviors/ISYOnOffBehavior.js +9 -7
  30. package/dist/cjs/Matter/Behaviors/ISYOnOffBehavior.js.map +1 -1
  31. package/dist/cjs/Matter/{Server → Bridge}/Server.js +27 -45
  32. package/dist/cjs/Matter/Bridge/Server.js.map +1 -0
  33. package/dist/cjs/Matter/Mappings/Insteon.js +19 -15
  34. package/dist/cjs/Matter/Mappings/Insteon.js.map +1 -1
  35. package/dist/cjs/Matter/Mappings/register.js +1 -0
  36. package/dist/cjs/Matter/Mappings/register.js.map +1 -0
  37. package/dist/cjs/Model/ClusterMap.js +12 -9
  38. package/dist/cjs/Model/ClusterMap.js.map +1 -1
  39. package/dist/cjs/Utils.js +29 -9
  40. package/dist/cjs/Utils.js.map +1 -1
  41. package/dist/cjs/types/CodeGeneration/EnumFactory.d.ts +1 -1
  42. package/dist/cjs/types/Converters.d.ts +28 -8
  43. package/dist/cjs/types/Converters.d.ts.map +1 -1
  44. package/dist/cjs/types/Definitions/Global/Drivers.d.ts +4 -3
  45. package/dist/cjs/types/Definitions/Global/Drivers.d.ts.map +1 -1
  46. package/dist/cjs/types/Definitions/Global/Events.d.ts.map +1 -1
  47. package/dist/cjs/types/Devices/Elk/ElkAlarmSensorDevice.d.ts.map +1 -1
  48. package/dist/cjs/types/Devices/EndpointFor.d.ts +2 -2
  49. package/dist/cjs/types/Devices/Insteon/InsteonBaseDevice.d.ts +3 -3
  50. package/dist/cjs/types/Devices/Insteon/InsteonBaseDevice.d.ts.map +1 -1
  51. package/dist/cjs/types/Devices/Insteon/InsteonDevice.d.ts +4 -4
  52. package/dist/cjs/types/Devices/Insteon/InsteonFanDevice.d.ts +5 -4
  53. package/dist/cjs/types/Devices/Insteon/InsteonFanDevice.d.ts.map +1 -1
  54. package/dist/cjs/types/Devices/Insteon/InsteonRelayDevice.d.ts +2 -4
  55. package/dist/cjs/types/Devices/Insteon/InsteonRelayDevice.d.ts.map +1 -1
  56. package/dist/cjs/types/Devices/Insteon/RelayLampSwitch.d.ts +93 -0
  57. package/dist/cjs/types/Devices/Insteon/RelayLampSwitch.d.ts.map +1 -0
  58. package/dist/cjs/types/ISY.d.ts +56 -52
  59. package/dist/cjs/types/ISY.d.ts.map +1 -1
  60. package/dist/cjs/types/ISYNode.d.ts +4 -4
  61. package/dist/cjs/types/ISYNode.d.ts.map +1 -1
  62. package/dist/cjs/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts +16 -6
  63. package/dist/cjs/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts.map +1 -1
  64. package/dist/cjs/types/Matter/Behaviors/ISYClusterBehavior.d.ts +13 -11
  65. package/dist/cjs/types/Matter/Behaviors/ISYClusterBehavior.d.ts.map +1 -1
  66. package/dist/cjs/types/Matter/Behaviors/ISYOnOffBehavior.d.ts +4 -4
  67. package/dist/cjs/types/Matter/Behaviors/ISYOnOffBehavior.d.ts.map +1 -1
  68. package/dist/cjs/types/Matter/Bridge/Server.d.ts +17 -0
  69. package/dist/cjs/types/Matter/Bridge/Server.d.ts.map +1 -0
  70. package/dist/cjs/types/Matter/Mappings/register.d.ts +1 -0
  71. package/dist/cjs/types/Matter/Mappings/register.d.ts.map +1 -0
  72. package/dist/cjs/types/Model/ClusterMap.d.ts +19 -11
  73. package/dist/cjs/types/Model/ClusterMap.d.ts.map +1 -1
  74. package/dist/cjs/types/Utils.d.ts +2 -5
  75. package/dist/cjs/types/Utils.d.ts.map +1 -1
  76. package/dist/esm/Converters.js +63 -28
  77. package/dist/esm/Converters.js.map +1 -1
  78. package/dist/esm/Definitions/Global/Drivers.js +10 -3
  79. package/dist/esm/Definitions/Global/Drivers.js.map +1 -1
  80. package/dist/esm/Definitions/Global/Events.js +1 -2
  81. package/dist/esm/Definitions/Global/Events.js.map +1 -1
  82. package/dist/esm/Devices/Elk/ElkAlarmPanelDevice.js +3 -3
  83. package/dist/esm/Devices/Elk/ElkAlarmSensorDevice.js +9 -6
  84. package/dist/esm/Devices/Elk/ElkAlarmSensorDevice.js.map +1 -1
  85. package/dist/esm/Devices/Insteon/InsteonBaseDevice.js +6 -4
  86. package/dist/esm/Devices/Insteon/InsteonBaseDevice.js.map +1 -1
  87. package/dist/esm/Devices/Insteon/InsteonFanDevice.js +7 -3
  88. package/dist/esm/Devices/Insteon/InsteonFanDevice.js.map +1 -1
  89. package/dist/esm/Devices/Insteon/InsteonMotionSensorDevice.js +5 -5
  90. package/dist/esm/Devices/Insteon/InsteonRelayDevice.js +3 -8
  91. package/dist/esm/Devices/Insteon/InsteonRelayDevice.js.map +1 -1
  92. package/dist/esm/Devices/Insteon/RelayLampSwitch.js +68 -0
  93. package/dist/esm/Devices/Insteon/RelayLampSwitch.js.map +1 -0
  94. package/dist/esm/ISY.js +191 -171
  95. package/dist/esm/ISY.js.map +1 -1
  96. package/dist/esm/ISYNode.js +34 -15
  97. package/dist/esm/ISYNode.js.map +1 -1
  98. package/dist/esm/ISYScene.js +3 -3
  99. package/dist/esm/ISYScene.js.map +1 -1
  100. package/dist/esm/Matter/Behaviors/ISYBridgedDeviceBehavior.js +11 -4
  101. package/dist/esm/Matter/Behaviors/ISYBridgedDeviceBehavior.js.map +1 -1
  102. package/dist/esm/Matter/Behaviors/ISYClusterBehavior.js +26 -7
  103. package/dist/esm/Matter/Behaviors/ISYClusterBehavior.js.map +1 -1
  104. package/dist/esm/Matter/Behaviors/ISYOnOffBehavior.js +10 -8
  105. package/dist/esm/Matter/Behaviors/ISYOnOffBehavior.js.map +1 -1
  106. package/dist/esm/Matter/{Server → Bridge}/Server.js +25 -44
  107. package/dist/esm/Matter/Bridge/Server.js.map +1 -0
  108. package/dist/esm/Matter/Mappings/Insteon.js +22 -18
  109. package/dist/esm/Matter/Mappings/Insteon.js.map +1 -1
  110. package/dist/esm/Matter/Mappings/register.js +2 -0
  111. package/dist/esm/Matter/Mappings/register.js.map +1 -0
  112. package/dist/esm/Model/ClusterMap.js +12 -9
  113. package/dist/esm/Model/ClusterMap.js.map +1 -1
  114. package/dist/esm/Utils.js +25 -8
  115. package/dist/esm/Utils.js.map +1 -1
  116. package/dist/esm/types/CodeGeneration/EnumFactory.d.ts +1 -1
  117. package/dist/esm/types/Converters.d.ts +28 -8
  118. package/dist/esm/types/Converters.d.ts.map +1 -1
  119. package/dist/esm/types/Definitions/Global/Drivers.d.ts +4 -3
  120. package/dist/esm/types/Definitions/Global/Drivers.d.ts.map +1 -1
  121. package/dist/esm/types/Definitions/Global/Events.d.ts.map +1 -1
  122. package/dist/esm/types/Devices/Elk/ElkAlarmSensorDevice.d.ts.map +1 -1
  123. package/dist/esm/types/Devices/EndpointFor.d.ts +2 -2
  124. package/dist/esm/types/Devices/Insteon/InsteonBaseDevice.d.ts +3 -3
  125. package/dist/esm/types/Devices/Insteon/InsteonBaseDevice.d.ts.map +1 -1
  126. package/dist/esm/types/Devices/Insteon/InsteonDevice.d.ts +4 -4
  127. package/dist/esm/types/Devices/Insteon/InsteonFanDevice.d.ts +5 -4
  128. package/dist/esm/types/Devices/Insteon/InsteonFanDevice.d.ts.map +1 -1
  129. package/dist/esm/types/Devices/Insteon/InsteonRelayDevice.d.ts +2 -4
  130. package/dist/esm/types/Devices/Insteon/InsteonRelayDevice.d.ts.map +1 -1
  131. package/dist/esm/types/Devices/Insteon/RelayLampSwitch.d.ts +93 -0
  132. package/dist/esm/types/Devices/Insteon/RelayLampSwitch.d.ts.map +1 -0
  133. package/dist/esm/types/ISY.d.ts +56 -52
  134. package/dist/esm/types/ISY.d.ts.map +1 -1
  135. package/dist/esm/types/ISYNode.d.ts +4 -4
  136. package/dist/esm/types/ISYNode.d.ts.map +1 -1
  137. package/dist/esm/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts +16 -6
  138. package/dist/esm/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts.map +1 -1
  139. package/dist/esm/types/Matter/Behaviors/ISYClusterBehavior.d.ts +13 -11
  140. package/dist/esm/types/Matter/Behaviors/ISYClusterBehavior.d.ts.map +1 -1
  141. package/dist/esm/types/Matter/Behaviors/ISYOnOffBehavior.d.ts +4 -4
  142. package/dist/esm/types/Matter/Behaviors/ISYOnOffBehavior.d.ts.map +1 -1
  143. package/dist/esm/types/Matter/Bridge/Server.d.ts +17 -0
  144. package/dist/esm/types/Matter/Bridge/Server.d.ts.map +1 -0
  145. package/dist/esm/types/Matter/Mappings/register.d.ts +2 -0
  146. package/dist/esm/types/Matter/Mappings/register.d.ts.map +1 -0
  147. package/dist/esm/types/Model/ClusterMap.d.ts +19 -11
  148. package/dist/esm/types/Model/ClusterMap.d.ts.map +1 -1
  149. package/dist/esm/types/Utils.d.ts +2 -5
  150. package/dist/esm/types/Utils.d.ts.map +1 -1
  151. package/package.json +5 -10
  152. package/src/Converters.ts +137 -69
  153. package/src/Definitions/Global/Drivers.ts +16 -7
  154. package/src/Definitions/Global/Events.ts +4 -3
  155. package/src/Devices/Elk/ElkAlarmPanelDevice.ts +3 -3
  156. package/src/Devices/Elk/ElkAlarmSensorDevice.ts +15 -21
  157. package/src/Devices/Insteon/Generated/RelayLamp.ts +8 -7
  158. package/src/Devices/Insteon/InsteonBaseDevice.ts +10 -9
  159. package/src/Devices/Insteon/InsteonFanDevice.ts +16 -11
  160. package/src/Devices/Insteon/InsteonMotionSensorDevice.ts +5 -5
  161. package/src/Devices/Insteon/InsteonRelayDevice.ts +3 -5
  162. package/src/Devices/Insteon/RelayLampSwitch.ts +131 -0
  163. package/src/ISY.ts +816 -819
  164. package/src/ISYNode.ts +33 -17
  165. package/src/ISYScene.ts +3 -3
  166. package/src/Matter/Behaviors/ISYBridgedDeviceBehavior.ts +29 -11
  167. package/src/Matter/Behaviors/ISYClusterBehavior.ts +46 -28
  168. package/src/Matter/Behaviors/ISYOnOffBehavior.ts +49 -60
  169. package/src/Matter/{Server → Bridge}/Server.ts +47 -51
  170. package/src/Matter/Mappings/Insteon.ts +53 -60
  171. package/src/Matter/Mappings/register.ts +0 -0
  172. package/src/Model/ClassDefinition.ts +1 -1
  173. package/src/Model/ClusterMap.ts +31 -22
  174. package/src/Utils.ts +26 -19
  175. package/tsconfig.json +2 -2
  176. package/LICENSE +0 -22
  177. package/dist/cjs/Matter/Server/Server.js.map +0 -1
  178. package/dist/cjs/types/Matter/Server/Server.d.ts +0 -4
  179. package/dist/cjs/types/Matter/Server/Server.d.ts.map +0 -1
  180. package/dist/esm/Matter/Server/Server.js.map +0 -1
  181. package/dist/esm/types/Matter/Server/Server.d.ts +0 -4
  182. package/dist/esm/types/Matter/Server/Server.d.ts.map +0 -1
  183. package/dist/tsconfig.cjs.tsbuildinfo +0 -1
  184. package/dist/tsconfig.esm.tsbuildinfo +0 -1
@@ -1,4 +1,3 @@
1
-
2
1
  import { Family } from '../../Definitions/Global/Families.js';
3
2
  import { ISY } from '../../ISY.js';
4
3
  import { ISYDeviceNode } from '../ISYDeviceNode.js';
@@ -6,7 +5,7 @@ import { AlarmSensorPhysicalState, AlarmSensorLogicalState } from './ElkAlarmPan
6
5
  /////////////////////////////
7
6
  // ELKAlarmSensor
8
7
  //
9
- export class ElkAlarmSensorDevice extends ISYDeviceNode<Family.Global,any,any> {
8
+ export class ElkAlarmSensorDevice extends ISYDeviceNode<Family.Global, any, any> {
10
9
  [x: string]: any;
11
10
  public area: number;
12
11
  public zone: string;
@@ -17,9 +16,12 @@ export class ElkAlarmSensorDevice extends ISYDeviceNode<Family.Global,any,any> {
17
16
  public physicalState: AlarmSensorPhysicalState;
18
17
  public logicalState: AlarmSensorLogicalState;
19
18
  public voltage: number;
20
- constructor (isy: ISY, name: string, area: number, zone: string) {
19
+ constructor(isy: ISY, name: string, area: number, zone: string) {
21
20
  super(isy, {
22
- family: Family.Global, name, address: `ElkZone_${zone}`, enabled: true,
21
+ family: Family.Global,
22
+ name,
23
+ address: `ElkZone_${zone}`,
24
+ enabled: true,
23
25
  pnode: undefined,
24
26
  startDelay: 0,
25
27
  hint: '',
@@ -49,13 +51,13 @@ export class ElkAlarmSensorDevice extends ISYDeviceNode<Family.Global,any,any> {
49
51
  return this.physicalState;
50
52
  }
51
53
  public isBypassed() {
52
- return (this.logicalState === 3);
54
+ return this.logicalState === 3;
53
55
  }
54
56
  public getLogicalState() {
55
57
  return this.logicalState;
56
58
  }
57
59
  public getCurrentDoorWindowState() {
58
- return (this.physicalState === this.SENSOR_STATE_PHYSICAL_OPEN || this.logicalState === this.SENSOR_STATE_LOGICAL_VIOLATED);
60
+ return this.physicalState === this.SENSOR_STATE_PHYSICAL_OPEN || this.logicalState === this.SENSOR_STATE_LOGICAL_VIOLATED;
59
61
  }
60
62
  public getSensorStatus() {
61
63
  return 'PS [' + this.physicalState + '] LS [' + this.logicatState + ']';
@@ -63,17 +65,11 @@ export class ElkAlarmSensorDevice extends ISYDeviceNode<Family.Global,any,any> {
63
65
  public isPresent() {
64
66
  if (this.voltage < 65 || this.voltage > 80) {
65
67
  return true;
66
- }
67
- else {
68
+ } else {
68
69
  return false;
69
70
  }
70
71
  }
71
- public override handleEvent(event: {
72
- control?: string;
73
- data?: any;
74
- node?: any;
75
- eventInfo?: any;
76
- }) {
72
+ public override handleEvent(event: { control?: string; data?: any; node?: any; eventInfo?: any }) {
77
73
  const zoneUpdate = event.eventInfo.ze;
78
74
  const zone = zoneUpdate.attr.zone;
79
75
  const updateType = zoneUpdate.attr.type;
@@ -84,24 +80,22 @@ export class ElkAlarmSensorDevice extends ISYDeviceNode<Family.Global,any,any> {
84
80
  if (this.logicalState !== valueToSet) {
85
81
  const temp = this.logicalState;
86
82
  this.logicalState = valueToSet;
87
- this.emit('PropertyChanged', 'logicalState', this.logicalState, temp, this.voltage.toString());
83
+ this.emit('propertyChanged', 'logicalState', this.logicalState, temp, this.voltage.toString());
88
84
  // Not triggering change update on logical state because physical always follows and don't want double notify.
89
85
  // valueChanged = true;
90
86
  }
91
- }
92
- else if (updateType === 52) {
87
+ } else if (updateType === 52) {
93
88
  if (this.physicalState !== valueToSet) {
94
89
  const temp = this.physicalState;
95
90
  this.physicalState = valueToSet;
96
- this.emit('PropertyChanged', 'physicalState', this.physicalState, temp, this.voltage.toString());
91
+ this.emit('propertyChanged', 'physicalState', this.physicalState, temp, this.voltage.toString());
97
92
  valueChanged = true;
98
93
  }
99
- }
100
- else if (updateType === 53) {
94
+ } else if (updateType === 53) {
101
95
  if (this.voltage !== valueToSet) {
102
96
  const temp = this.voltage;
103
97
  this.voltage = valueToSet;
104
- this.emit('PropertyChanged', 'voltage', this.voltage, temp, this.voltage.toString());
98
+ this.emit('propertyChanged', 'voltage', this.voltage, temp, this.voltage.toString());
105
99
  valueChanged = true;
106
100
  }
107
101
  }
@@ -1,5 +1,5 @@
1
- /* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT DIRECTLY. */
2
-
1
+ /* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT DIRECTLY. */
2
+
3
3
  import { UnitOfMeasure } from "../../../Definitions/Global/UOM.js";
4
4
  import { Family } from "../../../Definitions/Global/Families.js";
5
5
  import type { NodeInfo } from "../../../Model/NodeInfo.js";
@@ -11,12 +11,12 @@ import { Driver } from "../../../Definitions/Global/Drivers.js";
11
11
  import { Insteon } from "../../../Definitions/index.js";
12
12
  import type { DriverState } from "../../../Model/DriverState.js";
13
13
  import { NodeFactory } from "../../NodeFactory.js";
14
-
14
+
15
15
  export const nodeDefId = "RelayLampOnly";
16
-
16
+
17
17
  type Commands = RelayLamp.Commands;
18
18
  type Drivers = RelayLamp.Drivers;
19
-
19
+
20
20
  export class RelayLampNode extends Base<Drivers, Commands> implements RelayLamp.Interface {
21
21
  public readonly commands = {
22
22
  DON: this.on,
@@ -33,6 +33,7 @@ export class RelayLampNode extends Base<Drivers, Commands> implements RelayLamp.
33
33
  super(isy, nodeInfo);
34
34
  this.drivers.ST = Driver.create("ST", this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Percent, label: "Status", name: "status" });
35
35
  this.drivers.ERR = Driver.create("ERR", this, nodeInfo.property as DriverState, { uom: UnitOfMeasure.Index, label: "Responding", name: "responding" });
36
+
36
37
  }
37
38
  async on(value?: (0 | 100)) {
38
39
  return this.sendCommand("DON", { value: value });
@@ -62,9 +63,9 @@ export class RelayLampNode extends Base<Drivers, Commands> implements RelayLamp.
62
63
  return this.drivers.ERR?.value;
63
64
  }
64
65
  }
65
-
66
+
66
67
  NodeFactory.register(RelayLampNode);
67
-
68
+
68
69
  export namespace RelayLamp {
69
70
  export interface Interface extends Omit<InstanceType<typeof RelayLampNode>, keyof ISYDeviceNode<any, any, any, any>> {
70
71
  nodeDefId: "RelayLampOnly";
@@ -1,16 +1,17 @@
1
+ import 'winston';
2
+ import { Converter } 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
  }
@@ -37,7 +38,7 @@ export class InsteonBaseDevice<D extends ISYNode.DriverSignatures = {}, C extend
37
38
  case UOM.DegreeX2:
38
39
  return byteToDegree(value);
39
40
  case UOM.LevelFrom0To255:
40
- return Converters.Standard.LevelFrom0To255.Percent.to(value);
41
+ return Converter.Standard.LevelFrom0To255.Percent.to(value);
41
42
  case UOM.Fahrenheit:
42
43
  return value / 10;
43
44
  default:
@@ -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';
9
- import {Insteon} from './index.js';
8
+ import type { NodeInfo, StaticNodeInfo } from '../../Model/NodeInfo.js';
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
 
@@ -22,7 +25,7 @@ export class InsteonFanMotorDevice extends InsteonBaseDevice {
22
25
  }
23
26
 
24
27
  public async updateFanSpeed(level: number) {
25
- return (level);
28
+ return level;
26
29
  }
27
30
  public async updateIsOn(isOn: boolean) {
28
31
  if (!isOn) {
@@ -31,7 +34,6 @@ export class InsteonFanMotorDevice extends InsteonBaseDevice {
31
34
  //return this.commands.BEEP(States.Level.Max);
32
35
  }
33
36
  }
34
-
35
37
  }
36
38
 
37
39
  export class InsteonFanDevice extends InsteonBaseDevice {
@@ -40,11 +42,11 @@ export class InsteonFanDevice extends InsteonBaseDevice {
40
42
  constructor(isy: ISY, deviceNode: NodeInfo) {
41
43
  super(isy, deviceNode);
42
44
  this.light = new InsteonDimmableDevice(isy, deviceNode);
43
- this.light.events.on('PropertyChanged', ((a: any, b: any, c: any, d: string) => { this.emit('PropertyChanged', `light.${a}`, b, c, d); }).bind(this));
45
+ /*this.light.events.on('PropertyChanged', ((a: any, b: any, c: any, d: string) => { this.emit('PropertyChanged', `light.${a}`, b, c, d); }).bind(this));*/
44
46
  this.addChild(this.light);
45
47
  }
46
48
 
47
- public override handleEvent(event: { control?: string; data?: any; node?: any; }): boolean {
49
+ public override handleEvent(event: { control?: string; data?: any; node?: any }): boolean {
48
50
  this.logger(JSON.stringify(event));
49
51
  const child = this.children.find((p) => p.address === event.node);
50
52
  if (child !== undefined) {
@@ -58,13 +60,16 @@ export class InsteonFanDevice extends InsteonBaseDevice {
58
60
  if (childDevice instanceof InsteonFanMotorDevice) {
59
61
  this.logger('Fan Motor Found');
60
62
  this.motor = childDevice as InsteonFanMotorDevice;
61
- this.motor.events.on('statusChanged', ((a: any, b: any, c: any, d: string) => { this.emit('PropertyChanged', `motor.${a}`, b, c, d); }).bind(this));
63
+ this.motor.events.on(
64
+ 'statusChanged',
65
+ ((a: any, b: any, c: any, d: string) => {
66
+ this.emit('propertyChanged', `motor.${a}`, b, c, d);
67
+ }).bind(this)
68
+ );
62
69
  }
63
70
  }
64
71
 
65
72
  public async updateFanSpeed(level: number) {
66
73
  return this.motor.updateFanSpeed(level);
67
74
  }
68
-
69
-
70
75
  }
@@ -16,13 +16,13 @@ export class InsteonMotionSensorDevice extends InsteonBaseDevice {
16
16
  if (controlName === Commands.On) {
17
17
  this.logger('Motion detected.');
18
18
  this._isMotionDetected = true;
19
- this.emit('ControlTriggered',controlName);
20
- this.emit('PropertyChanged', 'motionDetected', true, false, "true");
19
+ this.emit('controlTriggered',controlName);
20
+ this.emit('propertyChanged', 'motionDetected', true, false, "true");
21
21
 
22
22
  setTimeout(() => {
23
23
  this.logger('No motion detected in last 30 seconds.');
24
24
  this._isMotionDetected = false;
25
- this.emit('PropertyChanged', 'motionDetected', false, true, "false"); /*Included for compatiblity purposes*/
25
+ this.emit('propertyChanged', 'motionDetected', false, true, "false"); /*Included for compatiblity purposes*/
26
26
  }, 30000);
27
27
  return true;
28
28
  }
@@ -30,8 +30,8 @@ export class InsteonMotionSensorDevice extends InsteonBaseDevice {
30
30
  else if (controlName === Commands.Off) {
31
31
  this._isMotionDetected = false;
32
32
  this.logger('No motion detected.');
33
- this.emit('ControlTriggered',controlName);
34
- this.emit('PropertyChanged', 'motionDetected', false, true, "false");
33
+ this.emit('controlTriggered',controlName);
34
+ this.emit('propertyChanged', 'motionDetected', false, true, "false");
35
35
  return true;
36
36
  }
37
37
 
@@ -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,14 +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'>, 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
23
  }
26
24
 
27
25
  // #endregion Constructors (1)
@@ -57,7 +55,7 @@ export class InsteonRelayDevice extends InsteonBaseDevice<Driver.Signatures<'ST'
57
55
 
58
56
  } */
59
57
  public override async sendBeep(level: number = 100): Promise<any> {
60
- return super.sendBeep(level);
58
+ return super.beep(level);
61
59
  }
62
60
 
63
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
+ }