isy-nodejs 1.0.1-alpha.26 → 1.0.1-alpha.28

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 (218) hide show
  1. package/dist/cjs/CodeGeneration/EnumFactory.js +6 -6
  2. package/dist/cjs/CodeGeneration/EnumFactory.js.map +1 -1
  3. package/dist/cjs/CodeGeneration/NodeClassFactory.js +7 -7
  4. package/dist/cjs/CodeGeneration/NodeClassFactory.js.map +1 -1
  5. package/dist/cjs/Converters.js +10 -13
  6. package/dist/cjs/Converters.js.map +1 -1
  7. package/dist/cjs/Definitions/Global/Commands.js.map +1 -1
  8. package/dist/cjs/Devices/ISYDeviceNode.js.map +1 -1
  9. package/dist/cjs/Devices/Insteon/DimmerLampSwitch.js +2 -2
  10. package/dist/cjs/Devices/Insteon/DimmerLampSwitch.js.map +1 -1
  11. package/dist/cjs/Devices/Insteon/InsteonDevice.js.map +1 -1
  12. package/dist/cjs/Devices/Insteon/InsteonDeviceFactory.js +12 -8
  13. package/dist/cjs/Devices/Insteon/InsteonDeviceFactory.js.map +1 -1
  14. package/dist/cjs/Devices/Insteon/InsteonKeypadDevice.js +2 -2
  15. package/dist/cjs/Devices/Insteon/InsteonKeypadDevice.js.map +1 -1
  16. package/dist/cjs/Devices/Insteon/KeypadButton.js +52 -0
  17. package/dist/cjs/Devices/Insteon/KeypadButton.js.map +1 -0
  18. package/dist/cjs/Devices/Insteon/RelayLampSwitch.js +5 -5
  19. package/dist/cjs/Devices/Insteon/RelayLampSwitch.js.map +1 -1
  20. package/dist/cjs/Devices/NodeFactory.js +5 -4
  21. package/dist/cjs/Devices/NodeFactory.js.map +1 -1
  22. package/dist/cjs/Devices/index.js.map +1 -1
  23. package/dist/cjs/ISY.js +220 -213
  24. package/dist/cjs/ISY.js.map +1 -1
  25. package/dist/cjs/ISYNode.js +3 -3
  26. package/dist/cjs/ISYNode.js.map +1 -1
  27. package/dist/cjs/ISYScene.js +1 -1
  28. package/dist/cjs/ISYScene.js.map +1 -1
  29. package/dist/cjs/Matter/Behaviors/ISYBridgedDeviceBehavior.js.map +1 -1
  30. package/dist/cjs/Matter/Behaviors/ISYClusterBehavior.js +7 -5
  31. package/dist/cjs/Matter/Behaviors/ISYClusterBehavior.js.map +1 -1
  32. package/dist/cjs/Matter/Behaviors/ISYOnOffBehavior.js +1 -1
  33. package/dist/cjs/Matter/Behaviors/ISYOnOffBehavior.js.map +1 -1
  34. package/dist/cjs/Matter/Behaviors/Insteon/ISYOnOffBehavior.js +47 -0
  35. package/dist/cjs/Matter/Behaviors/Insteon/ISYOnOffBehavior.js.map +1 -0
  36. package/dist/cjs/Matter/Bridge/Server.js +5 -5
  37. package/dist/cjs/Matter/Bridge/Server.js.map +1 -1
  38. package/dist/cjs/Matter/Mappings/Insteon.js +3 -4
  39. package/dist/cjs/Matter/Mappings/Insteon.js.map +1 -1
  40. package/dist/cjs/Model/ClusterMap.js +2 -2
  41. package/dist/cjs/Model/ClusterMap.js.map +1 -1
  42. package/dist/cjs/Model/NodeInfo.js +3 -3
  43. package/dist/cjs/Model/NodeInfo.js.map +1 -1
  44. package/dist/cjs/Utils.js.map +1 -1
  45. package/dist/cjs/types/CodeGeneration/EnumFactory.d.ts +1 -1
  46. package/dist/cjs/types/CodeGeneration/EnumFactory.d.ts.map +1 -1
  47. package/dist/cjs/types/CodeGeneration/NodeClassFactory.d.ts +1 -1
  48. package/dist/cjs/types/CodeGeneration/NodeClassFactory.d.ts.map +1 -1
  49. package/dist/cjs/types/Converters.d.ts +15 -2
  50. package/dist/cjs/types/Converters.d.ts.map +1 -1
  51. package/dist/cjs/types/Definitions/Global/Commands.d.ts +1 -1
  52. package/dist/cjs/types/Definitions/Global/Commands.d.ts.map +1 -1
  53. package/dist/cjs/types/Devices/EndpointFor.d.ts +1 -1
  54. package/dist/cjs/types/Devices/ISYDeviceNode.d.ts +2 -1
  55. package/dist/cjs/types/Devices/ISYDeviceNode.d.ts.map +1 -1
  56. package/dist/cjs/types/Devices/Insteon/DimmerLampSwitch.d.ts +1 -1
  57. package/dist/cjs/types/Devices/Insteon/DimmerLampSwitch.d.ts.map +1 -1
  58. package/dist/cjs/types/Devices/Insteon/InsteonDevice.d.ts +8 -7
  59. package/dist/cjs/types/Devices/Insteon/InsteonDevice.d.ts.map +1 -1
  60. package/dist/cjs/types/Devices/Insteon/InsteonDeviceFactory.d.ts +2 -1
  61. package/dist/cjs/types/Devices/Insteon/InsteonDeviceFactory.d.ts.map +1 -1
  62. package/dist/cjs/types/Devices/Insteon/InsteonFanDevice.d.ts.map +1 -1
  63. package/dist/cjs/types/Devices/Insteon/InsteonKeypadDevice.d.ts +4 -4
  64. package/dist/cjs/types/Devices/Insteon/InsteonKeypadDevice.d.ts.map +1 -1
  65. package/dist/cjs/types/Devices/Insteon/InsteonRelayDevice.d.ts.map +1 -1
  66. package/dist/cjs/types/Devices/Insteon/KeypadButton.d.ts +63 -0
  67. package/dist/cjs/types/Devices/Insteon/KeypadButton.d.ts.map +1 -0
  68. package/dist/cjs/types/Devices/Insteon/RelayLampSwitch.d.ts +32 -32
  69. package/dist/cjs/types/Devices/Insteon/RelayLampSwitch.d.ts.map +1 -1
  70. package/dist/cjs/types/Devices/NodeFactory.d.ts +2 -1
  71. package/dist/cjs/types/Devices/NodeFactory.d.ts.map +1 -1
  72. package/dist/cjs/types/Devices/index.d.ts +1 -1
  73. package/dist/cjs/types/Devices/index.d.ts.map +1 -1
  74. package/dist/cjs/types/ISY.d.ts +13 -28
  75. package/dist/cjs/types/ISY.d.ts.map +1 -1
  76. package/dist/cjs/types/ISYDevice.d.ts +1 -1
  77. package/dist/cjs/types/ISYDevice.d.ts.map +1 -1
  78. package/dist/cjs/types/ISYNode.d.ts +4 -2
  79. package/dist/cjs/types/ISYNode.d.ts.map +1 -1
  80. package/dist/cjs/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts +1 -1
  81. package/dist/cjs/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts.map +1 -1
  82. package/dist/cjs/types/Matter/Behaviors/ISYClusterBehavior.d.ts.map +1 -1
  83. package/dist/cjs/types/Matter/Behaviors/Insteon/ISYOnOffBehavior.d.ts +54 -0
  84. package/dist/cjs/types/Matter/Behaviors/Insteon/ISYOnOffBehavior.d.ts.map +1 -0
  85. package/dist/cjs/types/Matter/Bridge/Server.d.ts.map +1 -1
  86. package/dist/cjs/types/Model/ClusterMap.d.ts +1 -1
  87. package/dist/cjs/types/Model/ClusterMap.d.ts.map +1 -1
  88. package/dist/cjs/types/Model/EnumDefinition.d.ts +1 -1
  89. package/dist/cjs/types/Model/NodeInfo.d.ts +2 -2
  90. package/dist/cjs/types/Model/NodeInfo.d.ts.map +1 -1
  91. package/dist/cjs/types/Utils.d.ts +8 -1
  92. package/dist/cjs/types/Utils.d.ts.map +1 -1
  93. package/dist/esm/CodeGeneration/EnumFactory.js +1 -1
  94. package/dist/esm/CodeGeneration/EnumFactory.js.map +1 -1
  95. package/dist/esm/CodeGeneration/NodeClassFactory.js +1 -1
  96. package/dist/esm/CodeGeneration/NodeClassFactory.js.map +1 -1
  97. package/dist/esm/Converters.js +10 -13
  98. package/dist/esm/Converters.js.map +1 -1
  99. package/dist/esm/Definitions/Global/Commands.js.map +1 -1
  100. package/dist/esm/Devices/ISYDeviceNode.js.map +1 -1
  101. package/dist/esm/Devices/Insteon/DimmerLampSwitch.js +2 -2
  102. package/dist/esm/Devices/Insteon/DimmerLampSwitch.js.map +1 -1
  103. package/dist/esm/Devices/Insteon/InsteonDevice.js.map +1 -1
  104. package/dist/esm/Devices/Insteon/InsteonDeviceFactory.js +5 -1
  105. package/dist/esm/Devices/Insteon/InsteonDeviceFactory.js.map +1 -1
  106. package/dist/esm/Devices/Insteon/InsteonKeypadDevice.js +2 -2
  107. package/dist/esm/Devices/Insteon/InsteonKeypadDevice.js.map +1 -1
  108. package/dist/esm/Devices/Insteon/KeypadButton.js +48 -0
  109. package/dist/esm/Devices/Insteon/KeypadButton.js.map +1 -0
  110. package/dist/esm/Devices/Insteon/RelayLampSwitch.js +7 -7
  111. package/dist/esm/Devices/Insteon/RelayLampSwitch.js.map +1 -1
  112. package/dist/esm/Devices/NodeFactory.js +2 -1
  113. package/dist/esm/Devices/NodeFactory.js.map +1 -1
  114. package/dist/esm/Devices/index.js.map +1 -1
  115. package/dist/esm/ISY.js +220 -183
  116. package/dist/esm/ISY.js.map +1 -1
  117. package/dist/esm/ISYNode.js +2 -2
  118. package/dist/esm/ISYNode.js.map +1 -1
  119. package/dist/esm/ISYScene.js +1 -1
  120. package/dist/esm/ISYScene.js.map +1 -1
  121. package/dist/esm/Matter/Behaviors/ISYBridgedDeviceBehavior.js.map +1 -1
  122. package/dist/esm/Matter/Behaviors/ISYClusterBehavior.js +7 -5
  123. package/dist/esm/Matter/Behaviors/ISYClusterBehavior.js.map +1 -1
  124. package/dist/esm/Matter/Behaviors/ISYOnOffBehavior.js +1 -1
  125. package/dist/esm/Matter/Behaviors/ISYOnOffBehavior.js.map +1 -1
  126. package/dist/esm/Matter/Behaviors/Insteon/ISYOnOffBehavior.js +42 -0
  127. package/dist/esm/Matter/Behaviors/Insteon/ISYOnOffBehavior.js.map +1 -0
  128. package/dist/esm/Matter/Bridge/Server.js +6 -6
  129. package/dist/esm/Matter/Bridge/Server.js.map +1 -1
  130. package/dist/esm/Matter/Mappings/Insteon.js +3 -4
  131. package/dist/esm/Matter/Mappings/Insteon.js.map +1 -1
  132. package/dist/esm/Model/ClusterMap.js +2 -2
  133. package/dist/esm/Model/ClusterMap.js.map +1 -1
  134. package/dist/esm/Model/NodeInfo.js +1 -1
  135. package/dist/esm/Model/NodeInfo.js.map +1 -1
  136. package/dist/esm/Utils.js.map +1 -1
  137. package/dist/esm/types/CodeGeneration/EnumFactory.d.ts +1 -1
  138. package/dist/esm/types/CodeGeneration/EnumFactory.d.ts.map +1 -1
  139. package/dist/esm/types/CodeGeneration/NodeClassFactory.d.ts +1 -1
  140. package/dist/esm/types/CodeGeneration/NodeClassFactory.d.ts.map +1 -1
  141. package/dist/esm/types/Converters.d.ts +15 -2
  142. package/dist/esm/types/Converters.d.ts.map +1 -1
  143. package/dist/esm/types/Definitions/Global/Commands.d.ts +1 -1
  144. package/dist/esm/types/Definitions/Global/Commands.d.ts.map +1 -1
  145. package/dist/esm/types/Devices/EndpointFor.d.ts +1 -1
  146. package/dist/esm/types/Devices/ISYDeviceNode.d.ts +2 -1
  147. package/dist/esm/types/Devices/ISYDeviceNode.d.ts.map +1 -1
  148. package/dist/esm/types/Devices/Insteon/DimmerLampSwitch.d.ts +1 -1
  149. package/dist/esm/types/Devices/Insteon/DimmerLampSwitch.d.ts.map +1 -1
  150. package/dist/esm/types/Devices/Insteon/InsteonDevice.d.ts +8 -7
  151. package/dist/esm/types/Devices/Insteon/InsteonDevice.d.ts.map +1 -1
  152. package/dist/esm/types/Devices/Insteon/InsteonDeviceFactory.d.ts +2 -1
  153. package/dist/esm/types/Devices/Insteon/InsteonDeviceFactory.d.ts.map +1 -1
  154. package/dist/esm/types/Devices/Insteon/InsteonFanDevice.d.ts.map +1 -1
  155. package/dist/esm/types/Devices/Insteon/InsteonKeypadDevice.d.ts +4 -4
  156. package/dist/esm/types/Devices/Insteon/InsteonKeypadDevice.d.ts.map +1 -1
  157. package/dist/esm/types/Devices/Insteon/InsteonRelayDevice.d.ts.map +1 -1
  158. package/dist/esm/types/Devices/Insteon/KeypadButton.d.ts +63 -0
  159. package/dist/esm/types/Devices/Insteon/KeypadButton.d.ts.map +1 -0
  160. package/dist/esm/types/Devices/Insteon/RelayLampSwitch.d.ts +32 -32
  161. package/dist/esm/types/Devices/Insteon/RelayLampSwitch.d.ts.map +1 -1
  162. package/dist/esm/types/Devices/NodeFactory.d.ts +2 -1
  163. package/dist/esm/types/Devices/NodeFactory.d.ts.map +1 -1
  164. package/dist/esm/types/Devices/index.d.ts +1 -1
  165. package/dist/esm/types/Devices/index.d.ts.map +1 -1
  166. package/dist/esm/types/ISY.d.ts +13 -28
  167. package/dist/esm/types/ISY.d.ts.map +1 -1
  168. package/dist/esm/types/ISYDevice.d.ts +1 -1
  169. package/dist/esm/types/ISYDevice.d.ts.map +1 -1
  170. package/dist/esm/types/ISYNode.d.ts +4 -2
  171. package/dist/esm/types/ISYNode.d.ts.map +1 -1
  172. package/dist/esm/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts +1 -1
  173. package/dist/esm/types/Matter/Behaviors/ISYBridgedDeviceBehavior.d.ts.map +1 -1
  174. package/dist/esm/types/Matter/Behaviors/ISYClusterBehavior.d.ts.map +1 -1
  175. package/dist/esm/types/Matter/Behaviors/Insteon/ISYOnOffBehavior.d.ts +54 -0
  176. package/dist/esm/types/Matter/Behaviors/Insteon/ISYOnOffBehavior.d.ts.map +1 -0
  177. package/dist/esm/types/Matter/Bridge/Server.d.ts.map +1 -1
  178. package/dist/esm/types/Model/ClusterMap.d.ts +1 -1
  179. package/dist/esm/types/Model/ClusterMap.d.ts.map +1 -1
  180. package/dist/esm/types/Model/EnumDefinition.d.ts +1 -1
  181. package/dist/esm/types/Model/NodeInfo.d.ts +2 -2
  182. package/dist/esm/types/Model/NodeInfo.d.ts.map +1 -1
  183. package/dist/esm/types/Utils.d.ts +8 -1
  184. package/dist/esm/types/Utils.d.ts.map +1 -1
  185. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  186. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  187. package/package.json +2 -2
  188. package/src/CodeGeneration/EnumFactory.ts +2 -1
  189. package/src/CodeGeneration/NodeClassFactory.ts +2 -1
  190. package/src/Converters.ts +18 -24
  191. package/src/Definitions/Global/Commands.ts +13 -1
  192. package/src/Definitions/Global/Events.ts +2 -2
  193. package/src/Devices/ISYDeviceNode.ts +2 -1
  194. package/src/Devices/ISYMultiNodeDevice.ts +1 -1
  195. package/src/Devices/Insteon/DimmerLampSwitch.ts +3 -3
  196. package/src/Devices/Insteon/Generated/DimmerLampSwitch.ts +8 -7
  197. package/src/Devices/Insteon/InsteonDevice.ts +3 -2
  198. package/src/Devices/Insteon/InsteonDeviceFactory.ts +7 -2
  199. package/src/Devices/Insteon/InsteonFanDevice.ts +1 -1
  200. package/src/Devices/Insteon/InsteonKeypadDevice.ts +5 -5
  201. package/src/Devices/Insteon/InsteonRelayDevice.ts +1 -1
  202. package/src/Devices/Insteon/{Generated/KeypadButton.ts → KeypadButton.ts} +20 -20
  203. package/src/Devices/Insteon/RelayLampSwitch.ts +39 -39
  204. package/src/Devices/NodeFactory.ts +3 -2
  205. package/src/Devices/ZWave/ZWaveDimmerSwitchDevice.ts +1 -1
  206. package/src/Devices/index.ts +2 -2
  207. package/src/ISY.ts +249 -228
  208. package/src/ISYDevice.ts +3 -2
  209. package/src/ISYNode.ts +7 -5
  210. package/src/ISYScene.ts +2 -2
  211. package/src/Matter/Behaviors/ISYBridgedDeviceBehavior.ts +12 -2
  212. package/src/Matter/Behaviors/ISYClusterBehavior.ts +11 -14
  213. package/src/Matter/Behaviors/{ISYOnOffBehavior.ts → Insteon/ISYOnOffBehavior.ts} +9 -14
  214. package/src/Matter/Bridge/Server.ts +9 -7
  215. package/src/Matter/Mappings/Insteon.ts +3 -3
  216. package/src/Model/ClusterMap.ts +4 -3
  217. package/src/Model/NodeInfo.ts +4 -3
  218. package/src/Utils.ts +13 -6
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.26",
5
+ "version": "1.0.1-alpha.28",
6
6
  "author": {
7
7
  "name": "Pradeep Mouli"
8
8
  },
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "256b7ec74dbf1f1abcbfb7e0023f7c43ace45ad9"
72
+ "gitHead": "8db16499c0e5d154bfa3d13ccf0d31409abbb4ae"
73
73
  }
@@ -1,7 +1,7 @@
1
1
  import { factory } from "typescript";
2
2
  import { createWrappedNode, ts, type EnumDeclaration, EnumMember, Identifier } from 'ts-morph'
3
3
  import { UnitOfMeasure } from "../Definitions/Global/UOM.js";
4
- import { Family } from "../ISY.js";
4
+
5
5
  import type {
6
6
  NodeClassDefinition,
7
7
  DriverDefinition,
@@ -12,6 +12,7 @@ import { EnumDefinition, EnumDefinitionMap } from "../Model/EnumDefinition.js";
12
12
  import { isGeneratorFunction } from "util/types";
13
13
  import { Logger, loggers } from "winston";
14
14
  import { pascalCase } from 'moderndash';
15
+ import { Family } from '../Definitions/index.js';
15
16
 
16
17
 
17
18
  const logger = loggers.get("EnumFactory");
@@ -2,9 +2,10 @@ import { createWrappedNode, IndentationText, Project, QuoteKind, SourceFile, ts,
2
2
  import { factory, Statement, type Declaration } from 'typescript';
3
3
  import type { Driver } from '../Definitions/Global/Drivers.js';
4
4
  import { UnitOfMeasure } from '../Definitions/Global/UOM.js';
5
- import { Family } from '../ISY.js';
5
+
6
6
  import { CommandDefinition, DataTypeDefinition, DriverDefinition, NodeClassDefinition, ParameterDefinition } from '../Model/ClassDefinition.js';
7
7
  import { EnumDefinitionMap } from '../Model/EnumDefinition.js';
8
+ import { Family } from '../Definitions/index.js';
8
9
 
9
10
  // #region Type aliases (1)
10
11
 
package/src/Converters.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  import { UnitOfMeasure } from './Definitions/Global/UOM.js';
3
2
  import { type StringKeys } from './Utils.js';
4
3
 
@@ -9,26 +8,21 @@ let NullConverter: Converter<any, any>;
9
8
  from: (value: any) => value;
10
9
  }
11
10
 
12
- BooleanPercentage = {
13
- to: (value: number): boolean => {
14
- return value > 0;
15
- },
16
- from: (value: boolean): number => {
17
- return value ? 100 : 0;
18
- }
19
- };
20
-
21
- const StandardConverters: {
22
- [x in `${keyof typeof UnitOfMeasure}`]?: { [y in `${keyof typeof UnitOfMeasure}`]?: Converter<any, any> };
23
- } = {
11
+ const StandardConverters = {
24
12
  Boolean: {
25
13
  LevelFrom0To255: {
26
14
  to: (value: boolean) => (value ? 255 : 0),
27
15
  from: (value: number) => value > 0
28
16
  },
29
- Percent: BooleanPercentage
17
+ Percent: {
18
+ to: (value: number): boolean => {
19
+ return value > 0;
20
+ },
21
+ from: (value: boolean): number => {
22
+ return value ? 100 : 0;
23
+ }
24
+ }
30
25
  },
31
- Percent: {},
32
26
  LevelFrom0To255: {
33
27
  Percent: {
34
28
  to: (value: number): number => {
@@ -41,8 +35,8 @@ const StandardConverters: {
41
35
  }
42
36
  };
43
37
 
44
- StandardConverters.Percent.LevelFrom0To255 = invert(StandardConverters.LevelFrom0To255.Percent);
45
- StandardConverters.LevelFrom0To255.Boolean = invert(StandardConverters.Boolean.LevelFrom0To255);
38
+ //StandardConverters.Percent.LevelFrom0To255 = invert(StandardConverters.LevelFrom0To255.Percent);
39
+ //StandardConverters.LevelFrom0To255.Boolean = invert(StandardConverters.Boolean.LevelFrom0To255);
46
40
 
47
41
  export const StdConverterRegistry = new Map<UnitOfMeasure | string, Map<UnitOfMeasure | string, Converter<any, any>>>();
48
42
 
@@ -94,6 +88,7 @@ export namespace Converter {
94
88
  : value === 255 ? 254
95
89
  : value
96
90
  }
91
+
97
92
  }
98
93
  };
99
94
 
@@ -108,7 +103,7 @@ export namespace Converter {
108
103
  export type MatterConverters = `${MatterISYConvertibleTypes}.${ISYMatterConvertibleTypes}` | `${ISYMatterConvertibleTypes}.${MatterISYConvertibleTypes}`;
109
104
 
110
105
  export type KnownConverters = StandardConverters | MatterConverters;
111
- const cache : {[x:string]:Converter<any,any>} = {};
106
+ const cache: { [x: string]: Converter<any, any> } = {};
112
107
  export function get(label: KnownConverters): Converter<any, any>;
113
108
  export function get(from: UnitOfMeasure, to: UnitOfMeasure);
114
109
  export function get(from: ConverterTypes, to: ConverterTypes);
@@ -116,23 +111,22 @@ export namespace Converter {
116
111
  export function get(from: MatterISYConvertibleTypes, to: ISYMatterConvertibleTypes);
117
112
  export function get(to: ISYMatterConvertibleTypes, from: MatterISYConvertibleTypes);
118
113
  export function get(from: UnitOfMeasure | `${keyof typeof UnitOfMeasure}` | string, to?: UnitOfMeasure | `${keyof typeof UnitOfMeasure}` | string): Converter<any, any> {
119
- if(to === undefined) {
114
+ if (to === undefined) {
120
115
  return ConverterRegistry.get(from as string) ?? NullConverter;
121
116
  }
122
- if(cache[`${from}.${to}`]) {
117
+ if (cache[`${from}.${to}`]) {
123
118
  return cache[`${from}.${to}`];
124
- }
125
- else if(cache[`${to}.${from}`]) {
119
+ } else if (cache[`${to}.${from}`]) {
126
120
  cache[`${from}.${to}`] = invert(cache[`${to}.${from}`]);
127
121
  return cache[`${from}.${to}`];
128
122
  }
129
123
  let isString = typeof from === 'string';
130
124
  let fuom = isString ? from : UnitOfMeasure[from];
131
125
  if (to) {
132
- let tuom = typeof to === 'string' ? to : UnitOfMeasure[to]; ;
126
+ let tuom = typeof to === 'string' ? to : UnitOfMeasure[to];
133
127
 
134
128
  if (StdConverterRegistry.has(fuom)) {
135
- if(StdConverterRegistry.get(fuom).has(tuom)) {
129
+ if (StdConverterRegistry.get(fuom).has(tuom)) {
136
130
  return StdConverterRegistry.get(fuom).get(tuom);
137
131
  }
138
132
  }
@@ -1,10 +1,22 @@
1
1
  import { TimeFormatLocalization } from '@project-chip/matter.js/cluster';
2
2
  import type { Identity, Merge, UnionToIntersection } from '@project-chip/matter.js/util';
3
3
  import type { Sign } from 'crypto';
4
+ import type { UnitOfMeasure } from './UOM.js';
5
+
6
+ /*export class Command<T extends string> extends Function {
7
+
8
+ constructor(public readonly label: string) {
9
+ super();
10
+ }
11
+
12
+ public async execute(...args: any[]): Promise<Boolean> {
13
+ return this(...args);
14
+ }
15
+ }*/
4
16
 
5
17
  export namespace Command {
6
18
 
7
- export type Signature<F extends {name: string} = CallableFunction, L extends string = string,N extends string = string> = F & {label: L, name: N };
19
+ export type Signature<F extends {name} = CallableFunction, L extends string = string,N extends string = string> = F & {label: L, name: N,} ;
8
20
 
9
21
  export type Signatures<C extends string> = {[K in C]: Signature<(...args: any[]) => Promise<Boolean>, string, string>};
10
22
 
@@ -3,7 +3,7 @@ import type { AnyMxRecord } from 'dns';
3
3
  import EventEmitter, { on } from 'events';
4
4
  import type { EventType } from '../../Events/EventType.js';
5
5
  import { ISYEvent } from '../../Events/ISYEvent.js';
6
- import type { InsteonBaseDevice, ISY } from '../../ISY.js';
6
+ import type { ISY } from '../../ISY.js';
7
7
  import type { ISYNode } from '../../ISYNode.js';
8
8
  import type { UnitOfMeasure } from './UOM.js';
9
9
 
@@ -63,7 +63,7 @@ export namespace Event {
63
63
  ): FunctionSigFor<E, NodeEventEmitter<N>> & Omit<NodeEventEmitter<N>, 'on'> {
64
64
  var f = new NodeEventEmitter(node);
65
65
  for (let evt in node.drivers) {
66
-
66
+
67
67
  //f[`on${ev.name}`] = f.on.bind(f, ev.name);
68
68
  }
69
69
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  import type { Driver } from '../Definitions/Global/Drivers.js';
3
- import { type Family, type ISY, Controls } from '../ISY.js';
3
+ import {type ISY } from '../ISY.js';
4
4
  import type { ISYDevice } from '../ISYDevice.js';
5
5
  import { ISYNode} from '../ISYNode.js';
6
6
  import type { ISYScene } from '../ISYScene.js';
@@ -10,6 +10,7 @@ import type { Category } from '../Definitions/Global/Categories.js';
10
10
  import type { Command } from '../Definitions/Global/Commands.js';
11
11
  import type { Event } from '../Definitions/Global/Events.js';
12
12
  import type { StringKeys } from '../Utils.js';
13
+ import type { Family } from '../Definitions/index.js';
13
14
 
14
15
 
15
16
  export class ISYDeviceNode<
@@ -1,7 +1,7 @@
1
1
  //import type { UnionToIntersection } from '@project-chip/matter-node.js/util.js';
2
2
  import type { Driver } from '../Definitions/Global/Drivers.js';
3
3
  import type { UnitOfMeasure } from '../Definitions/Global/UOM.js';
4
- import type { Family } from '../ISY.js';
4
+
5
5
  import type { ISYDevice } from '../ISYDevice.js';
6
6
  import type { DriverMap, ISYNode, NodeList } from '../ISYNode.js';
7
7
  import type { ISYScene } from '../ISYScene.js';
@@ -39,13 +39,13 @@ export class DimmerLampSwitchNode extends Base<Drivers, Commands> implements Dim
39
39
  declare readonly nodeDefId: 'DimmerLampSwitch';
40
40
  constructor(isy: ISY, nodeInfo: NodeInfo) {
41
41
  super(isy, nodeInfo);
42
- this.drivers.ST = Driver.create('ST', this, nodeInfo.state['ST'], { uom: UnitOfMeasure.Percent, label: 'Status', name: 'status' });
42
+ this.drivers.ST = Driver.create('ST', this, nodeInfo.state['ST'], { uom: UnitOfMeasure.LevelFrom0To255, label: 'Status', name: 'status' });
43
43
  this.drivers.OL = Driver.create('OL', this, nodeInfo.state['OL'] as DriverState, { uom: UnitOfMeasure.Percent, label: 'On Level', name: 'onLevel' });
44
44
  this.drivers.RR = Driver.create('RR', this, nodeInfo.state['RR'] as DriverState, { uom: UnitOfMeasure.Index, label: 'Ramp Rate', name: 'rampRate' });
45
45
  this.drivers.ERR = Driver.create('ERR', this, nodeInfo.state['ERR'] as DriverState, { uom: UnitOfMeasure.Index, label: 'Responding', name: 'responding' });
46
46
  }
47
47
  async on(value?: number) {
48
- return this.sendCommand('DON', { value: value });
48
+ return this.sendCommand('DON', value);
49
49
  }
50
50
  async off() {
51
51
  return this.sendCommand('DOF');
@@ -180,7 +180,7 @@ export namespace DimmerLampSwitch {
180
180
  };
181
181
  export type Drivers = {
182
182
  ST: {
183
- uom: UnitOfMeasure.Percent;
183
+ uom: UnitOfMeasure.LevelFrom0To255;
184
184
  value: number;
185
185
  label: 'Status';
186
186
  name: 'status';
@@ -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,13 @@ 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
+ import { validateHeaderName } from 'http';
15
+
15
16
  export const nodeDefId = "DimmerLampSwitch";
16
-
17
+
17
18
  type Commands = DimmerLampSwitch.Commands;
18
19
  type Drivers = DimmerLampSwitch.Drivers;
19
-
20
+
20
21
  export class DimmerLampSwitchNode extends Base<Drivers, Commands> implements DimmerLampSwitch.Interface {
21
22
  public readonly commands = {
22
23
  DON: this.on,
@@ -102,9 +103,9 @@ export class DimmerLampSwitchNode extends Base<Drivers, Commands> implements Dim
102
103
  return this.drivers.ERR?.value;
103
104
  }
104
105
  }
105
-
106
+
106
107
  NodeFactory.register(DimmerLampSwitchNode);
107
-
108
+
108
109
  export namespace DimmerLampSwitch {
109
110
  export interface Interface extends Omit<InstanceType<typeof DimmerLampSwitchNode>, keyof ISYDeviceNode<any, any, any, any>> {
110
111
  nodeDefId: "DimmerLampSwitch";
@@ -1,4 +1,4 @@
1
- import { Family, InsteonBaseDevice, ISY, ISYDevice } from '../../ISY.js';
1
+ import { ISY } from '../../ISY.js';
2
2
 
3
3
  import { Insteon } from '../../Definitions/Global/Families.js';
4
4
  import { Commands } from '../../ISYConstants.js'
@@ -6,6 +6,7 @@ import { Constructor } from '../Constructor.js';
6
6
  import { InsteonKeypadButtonDevice } from './InsteonKeypadDevice.js';
7
7
  import { InsteonRelayDevice } from './InsteonRelayDevice.js';
8
8
  import 'winston';
9
+ import type { InsteonBaseDevice } from './InsteonBaseDevice.js';
9
10
 
10
11
  export const InsteonLampDevice = <T extends Constructor<InsteonBaseDevice>>(IB: T) => (class extends IB {
11
12
  declare isDimmable: boolean;
@@ -21,7 +22,7 @@ export const InsteonLampDevice = <T extends Constructor<InsteonBaseDevice>>(IB:
21
22
 
22
23
  export const KeypadDevice = <T extends Constructor<InsteonBaseDevice>>(IB: T) => (class extends IB {
23
24
 
24
-
25
+
25
26
  });
26
27
 
27
28
 
@@ -1,5 +1,5 @@
1
1
  import { Category } from '../../Definitions/Global/Categories.js';
2
- import { Family, InsteonBaseDevice, InsteonLockDevice, InsteonSmokeSensorDevice, InsteonThermostatDevice } from '../../ISY.js';
2
+
3
3
  import { parseTypeCode } from '../../Utils.js';
4
4
  import { NodeInfo } from '../../Model/NodeInfo.js';
5
5
  import { InsteonDimmableDevice } from './InsteonDimmableDevice.js';
@@ -19,6 +19,11 @@ import { ISYNode } from '../../ISYNode.js';
19
19
  import { DeviceDef, type CategoryDef, type FamilyDef } from '../DeviceMap.js';
20
20
  import { writeFileSync } from 'fs';
21
21
  import type { Constructor } from '../Constructor.js';
22
+ import { Family } from '../../Definitions/index.js';
23
+ import { InsteonBaseDevice } from './InsteonBaseDevice.js';
24
+ import { InsteonSmokeSensorDevice } from './InsteonSmokeSensorDevice.js';
25
+ import { InsteonThermostatDevice } from './InsteonThermostatDevice.js';
26
+ import { InsteonLockDevice } from './InsteonLockDevice.js';
22
27
 
23
28
 
24
29
 
@@ -327,7 +332,7 @@ export class InsteonDeviceFactory {
327
332
  retVal = { name: 'Plugin Relay', modelNumber: '2633-522' };
328
333
  }
329
334
  if (subAddress != '1' && retVal.class === InsteonKeypadRelayDevice) {
330
- retVal.class = InsteonKeypadButtonDevice;
335
+ retVal.class = InsteonKeypadButtonDevice as any;
331
336
  }
332
337
  if (retVal.class === undefined) { retVal.class = InsteonRelayDevice; }
333
338
  return retVal;
@@ -1,5 +1,5 @@
1
1
  import { Family } from '../../Definitions/Global/Families.js';
2
- import { ISY, ISYNode } from '../../ISY.js';
2
+ import { ISY } from '../../ISY.js';
3
3
  import { States } from '../../ISYConstants.js';
4
4
 
5
5
  import { InsteonBaseDevice } from './InsteonBaseDevice.js';
@@ -1,11 +1,11 @@
1
- import type { NodeInfo } from '../../Model/NodeInfo.js';
1
+ import 'winston';
2
2
  import { ISY } from '../../ISY.js';
3
+ import type { NodeInfo } from '../../Model/NodeInfo.js';
3
4
  import { InsteonRelayDevice } from './InsteonRelayDevice.js';
4
- import 'winston';
5
-
5
+ import { KeypadButton } from './KeypadButton.js';
6
6
 
7
- export class InsteonKeypadButtonDevice extends InsteonRelayDevice {
8
- constructor (isy: ISY, deviceNode: NodeInfo) {
7
+ export class InsteonKeypadButtonDevice extends KeypadButton.Node {
8
+ constructor(isy: ISY, deviceNode: NodeInfo) {
9
9
  super(isy, deviceNode);
10
10
  }
11
11
  }
@@ -1,4 +1,4 @@
1
- import { Family, ISY } from '../../ISY.js';
1
+ import { ISY } from '../../ISY.js';
2
2
 
3
3
  import { NodeInfo } from '../../Model/NodeInfo.js';
4
4
  import { EndpointFor } from '../EndpointFor.js';
@@ -1,29 +1,29 @@
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 { Base } from "../index.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
-
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 { Base } from "./index.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
15
  export const nodeDefId = "KeypadButton";
16
-
16
+
17
17
  type Commands = KeypadButton.Commands;
18
18
  type Drivers = KeypadButton.Drivers;
19
-
19
+
20
20
  export class KeypadButtonNode extends Base<Drivers, Commands> implements KeypadButton.Interface {
21
- public readonly commands = {
21
+ public override readonly commands = {
22
22
  QUERY: this.query,
23
23
  BL: this.backlight,
24
24
  WDU: this.writeChanges
25
25
  };
26
- static nodeDefId = "KeypadButton";
26
+ static override nodeDefId = "KeypadButton";
27
27
  declare readonly nodeDefId: "KeypadButton";
28
28
  constructor (isy: ISY, nodeInfo: NodeInfo) {
29
29
  super(isy, nodeInfo);
@@ -46,9 +46,9 @@ export class KeypadButtonNode extends Base<Drivers, Commands> implements KeypadB
46
46
  return this.drivers.ERR?.value;
47
47
  }
48
48
  }
49
-
49
+
50
50
  NodeFactory.register(KeypadButtonNode);
51
-
51
+
52
52
  export namespace KeypadButton {
53
53
  export interface Interface extends Omit<InstanceType<typeof KeypadButtonNode>, keyof ISYDeviceNode<any, any, any, any>> {
54
54
  nodeDefId: "KeypadButton";
@@ -1,18 +1,18 @@
1
1
  /* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT DIRECTLY. */
2
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";
3
+ import { Driver } from '../../Definitions/Global/Drivers.js';
4
+ import { Family } from '../../Definitions/Global/Families.js';
5
+ import { UnitOfMeasure } from '../../Definitions/Global/UOM.js';
6
+ import { Insteon } from '../../Definitions/index.js';
7
+ import type { ISY } from '../../ISY.js';
8
+ import type { ISYNode } from '../../ISYNode.js';
9
+ import type { DriverState } from '../../Model/DriverState.js';
10
+ import type { NodeInfo } from '../../Model/NodeInfo.js';
11
+ import { ISYDeviceNode } from '../ISYDeviceNode.js';
12
+ import { NodeFactory } from '../NodeFactory.js';
13
+ import { InsteonBaseDevice } from './InsteonBaseDevice.js';
14
14
 
15
- export const nodeDefId = "RelayLampSwitch";
15
+ export const nodeDefId = 'RelayLampSwitch';
16
16
 
17
17
  type Commands = RelayLampSwitch.Commands;
18
18
  type Drivers = RelayLampSwitch.Drivers;
@@ -32,11 +32,11 @@ export class RelayLampSwitchNode extends InsteonBaseDevice<Drivers, Commands> im
32
32
  declare readonly nodeDefId: 'RelayLampSwitch';
33
33
  constructor(isy: ISY, nodeInfo: NodeInfo) {
34
34
  super(isy, nodeInfo);
35
- this.drivers.ST = Driver.create('ST', this, nodeInfo.state['ST'], { uom: UnitOfMeasure.Percent, label: 'Status', name: 'status' });
35
+ this.drivers.ST = Driver.create('ST', this, nodeInfo.state['ST'], { uom: UnitOfMeasure.Boolean, label: 'Status', name: 'status' });
36
36
  this.drivers.ERR = Driver.create('ERR', this, nodeInfo.state['ERR'], { uom: UnitOfMeasure.Index, label: 'Responding', name: 'responding' });
37
37
  }
38
38
  async on(value?: 0 | 100) {
39
- return this.sendCommand('DON', { value: value });
39
+ return this.sendCommand('DON', value);
40
40
  }
41
41
  async off() {
42
42
  return this.sendCommand('DOF');
@@ -59,7 +59,7 @@ export class RelayLampSwitchNode extends InsteonBaseDevice<Drivers, Commands> im
59
59
  async writeChanges() {
60
60
  return this.sendCommand('WDU');
61
61
  }
62
- public get status(): Insteon.OnLevelRelay {
62
+ public get status(): boolean {
63
63
  return this.drivers.ST?.value;
64
64
  }
65
65
  public get responding(): Insteon.Error {
@@ -71,7 +71,7 @@ NodeFactory.register(RelayLampSwitchNode);
71
71
 
72
72
  export namespace RelayLampSwitch {
73
73
  export interface Interface extends Omit<InstanceType<typeof RelayLampSwitchNode>, keyof ISYDeviceNode<any, any, any, any>> {
74
- nodeDefId: "RelayLampSwitch";
74
+ nodeDefId: 'RelayLampSwitch';
75
75
  }
76
76
  export function is(node: ISYNode<any, any, any, any>): node is RelayLampSwitchNode {
77
77
  return node.nodeDefId === nodeDefId;
@@ -81,51 +81,51 @@ export namespace RelayLampSwitch {
81
81
  }
82
82
  export const Node = RelayLampSwitchNode;
83
83
  export type Commands = {
84
- DON: ((value?: (0 | 100)) => Promise<boolean>) & {
85
- label: "On";
86
- name: "on";
84
+ DON: ((value?: 0 | 100) => Promise<boolean>) & {
85
+ label: 'On';
86
+ name: 'on';
87
87
  };
88
88
  DOF: (() => Promise<boolean>) & {
89
- label: "Off";
90
- name: "off";
89
+ label: 'Off';
90
+ name: 'off';
91
91
  };
92
92
  DFOF: (() => Promise<boolean>) & {
93
- label: "Fast Off";
94
- name: "fastOff";
93
+ label: 'Fast Off';
94
+ name: 'fastOff';
95
95
  };
96
96
  DFON: (() => Promise<boolean>) & {
97
- label: "Fast On";
98
- name: "fastOn";
97
+ label: 'Fast On';
98
+ name: 'fastOn';
99
99
  };
100
100
  QUERY: (() => Promise<boolean>) & {
101
- label: "Query";
102
- name: "query";
101
+ label: 'Query';
102
+ name: 'query';
103
103
  };
104
104
  BEEP: ((value?: number) => Promise<boolean>) & {
105
- label: "Beep";
106
- name: "beep";
105
+ label: 'Beep';
106
+ name: 'beep';
107
107
  };
108
108
  BL: ((value: number) => Promise<boolean>) & {
109
- label: "Backlight";
110
- name: "backlight";
109
+ label: 'Backlight';
110
+ name: 'backlight';
111
111
  };
112
112
  WDU: (() => Promise<boolean>) & {
113
- label: "Write Changes";
114
- name: "writeChanges";
113
+ label: 'Write Changes';
114
+ name: 'writeChanges';
115
115
  };
116
116
  };
117
117
  export type Drivers = {
118
118
  ST: {
119
- uom: UnitOfMeasure.Percent;
120
- value: Insteon.OnLevelRelay;
121
- label: "Status";
122
- name: "status";
119
+ uom: UnitOfMeasure.Boolean;
120
+ value: boolean;
121
+ label: 'Status';
122
+ name: 'status';
123
123
  };
124
124
  ERR: {
125
125
  uom: UnitOfMeasure.Index;
126
126
  value: Insteon.Error;
127
- label: "Responding";
128
- name: "responding";
127
+ label: 'Responding';
128
+ name: 'responding';
129
129
  };
130
130
  };
131
131
  }
@@ -1,10 +1,11 @@
1
- import type { MaybePromise } from '@project-chip/matter.js/util';
2
- import { Family, ISY } from '../ISY.js';
1
+
2
+ import { ISY } from '../ISY.js';
3
3
  import { ISYNode } from '../ISYNode.js';
4
4
  import type { NodeDef } from '../Model/NodeDef.js';
5
5
  import { isDynamic, type NodeInfo } from '../Model/NodeInfo.js';
6
6
  import type { Constructor } from './Constructor.js';
7
7
  import type { IdentityOf } from '../Utils.js';
8
+ import { Family } from '../Definitions/index.js';
8
9
 
9
10
 
10
11
 
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- import { Family } from '../../ISY.js';
3
+
4
4
  import { ZWaveBaseDevice } from './ZWaveBaseDevice.js';
5
5
  import 'winston';
6
6
 
@@ -1,6 +1,6 @@
1
- import { Family } from "../ISY.js";
1
+
2
+ import type { Family } from '../Definitions/index.js';
2
3
  import {Insteon} from "./Insteon/index.js";
3
- import { ISYDeviceNode } from './ISYDeviceNode.js';
4
4
  import { ZWaveBaseDevice } from "./ZWave/ZWaveBaseDevice.js";
5
5
 
6
6
  export const Devices = {