isy-nodejs 1.0.8-alpha.0 → 1.0.9-alpha.1

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 (36) hide show
  1. package/dist/esm/Devices/Insteon/InsteonFanDevice.js +1 -3
  2. package/dist/esm/Devices/Insteon/InsteonFanDevice.js.map +1 -1
  3. package/dist/esm/Devices/Insteon/InsteonOnOffOutletDevice.js +11 -0
  4. package/dist/esm/Devices/Insteon/InsteonOnOffOutletDevice.js.map +1 -1
  5. package/dist/esm/ISY.js +1 -1
  6. package/dist/esm/ISY.js.map +1 -1
  7. package/dist/esm/Matter/Behaviors/ISYBridgedDeviceBehavior.js +1 -1
  8. package/dist/esm/Matter/Behaviors/ISYBridgedDeviceBehavior.js.map +1 -1
  9. package/dist/esm/Matter/Behaviors/index.js +6 -0
  10. package/dist/esm/Matter/Behaviors/index.js.map +1 -0
  11. package/dist/esm/Matter/Bridge/Server.js +2 -1
  12. package/dist/esm/Matter/Bridge/Server.js.map +1 -1
  13. package/dist/esm/Matter/Mappings/index.js +1 -0
  14. package/dist/esm/Matter/Mappings/index.js.map +1 -1
  15. package/dist/esm/types/Devices/Insteon/InsteonFanDevice.d.ts +1 -2
  16. package/dist/esm/types/Devices/Insteon/InsteonFanDevice.d.ts.map +1 -1
  17. package/dist/esm/types/Devices/Insteon/InsteonOnOffOutletDevice.d.ts +6 -0
  18. package/dist/esm/types/Devices/Insteon/InsteonOnOffOutletDevice.d.ts.map +1 -1
  19. package/dist/esm/types/Matter/Behaviors/Insteon/DimmerLevelControlBehavior.d.ts +4 -4
  20. package/dist/esm/types/Matter/Behaviors/Insteon/RelayOnOffBehavior.d.ts +4 -4
  21. package/dist/esm/types/Matter/Behaviors/index.d.ts +6 -0
  22. package/dist/esm/types/Matter/Behaviors/index.d.ts.map +1 -0
  23. package/dist/esm/types/Matter/Bridge/Server.d.ts +1 -0
  24. package/dist/esm/types/Matter/Bridge/Server.d.ts.map +1 -1
  25. package/dist/esm/types/Matter/Mappings/MappingRegistry.d.ts +64 -64
  26. package/dist/esm/types/Matter/Mappings/index.d.ts +1 -0
  27. package/dist/esm/types/Matter/Mappings/index.d.ts.map +1 -1
  28. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  29. package/package.json +2 -2
  30. package/src/Devices/Insteon/InsteonFanDevice.ts +1 -1
  31. package/src/Devices/Insteon/InsteonOnOffOutletDevice.ts +13 -0
  32. package/src/ISY.ts +1 -1
  33. package/src/Matter/Behaviors/ISYBridgedDeviceBehavior.ts +1 -1
  34. package/src/Matter/Behaviors/index.ts +6 -0
  35. package/src/Matter/Bridge/Server.ts +2 -1
  36. package/src/Matter/Mappings/index.ts +3 -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.8-alpha.0",
5
+ "version": "1.0.9-alpha.1",
6
6
  "author": {
7
7
  "name": "Pradeep Mouli"
8
8
  },
@@ -74,5 +74,5 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "4b88acc1e9ee5625c06cfa8cf7359aa0c3ff9faf"
77
+ "gitHead": "9521cb43ec9bffaa16e91234351abd5981c2037e"
78
78
  }
@@ -49,7 +49,7 @@ export class FanDevice extends CompositeDevice.of({ light: DimmerLamp.Node, moto
49
49
 
50
50
 
51
51
  export namespace Fan {
52
- export class Device extends FanDevice { }
52
+ export const Device = FanDevice;
53
53
 
54
54
  export const Motor = FanLincMotor;
55
55
 
@@ -4,9 +4,22 @@ import type { NodeInfo } from '../../Model/NodeInfo.js';
4
4
  import { RelayLamp } from './Generated/RelayLamp.js';
5
5
  import { InsteonRelayDevice } from './InsteonRelayDevice.js';
6
6
  import { CompositeDevice, CompositeOf } from '../CompositeDevice.js';
7
+ import type { ISYDevice } from '../../ISYDevice.js';
7
8
 
8
9
  export class OnOffOutlet extends CompositeDevice.of({ top: RelayLamp.Node, bottom: RelayLamp.Node }, {top: 1, bottom: 2}) {
9
10
  constructor(isy: ISY, deviceNode: NodeInfo) {
10
11
  super(isy, deviceNode);
11
12
  }
12
13
  }
14
+
15
+ export namespace OnOffOutlet {
16
+ export function is(node: ISYDevice<any, any, any, any>): node is OnOffOutlet {
17
+ return node instanceof OnOffOutlet;
18
+ }
19
+ export function create(isy: ISY, node: NodeInfo) {
20
+ return new OnOffOutlet(isy, node);
21
+ }
22
+
23
+ export const Device = OnOffOutlet;
24
+
25
+ }
package/src/ISY.ts CHANGED
@@ -831,7 +831,7 @@ export class ISY extends EventEmitter implements Disposable {
831
831
  parent.addNode(node);
832
832
 
833
833
  }
834
- else
834
+ else if(!this.deviceList.has(node.address))
835
835
  {
836
836
  this.deviceList.set(node.address, node as unknown as ISYDevice<any, any, any, any>);
837
837
  }
@@ -59,7 +59,7 @@ export class ISYBridgedDeviceBehavior<N extends ISYNode<any, D, any, any>, D ext
59
59
  }
60
60
 
61
61
  mapForBehavior<B extends ClusterBehavior>(behavior: B): ClusterMapping<B, typeof this.internal.device> {
62
- return this.map.mapping[behavior.cluster.name];
62
+ return this.map.mapping[behavior.cluster.name] ?? {attributes: {}, commands: {}};
63
63
  }
64
64
 
65
65
  handlePropertyChange(driver: string, newValue: any, oldValue: any, formattedValue: string) {
@@ -0,0 +1,6 @@
1
+ import './BehaviorRegistry.js';
2
+ export { BehaviorRegistry as Registry } from './BehaviorRegistry.js';
3
+
4
+ export * from './ISYBridgedDeviceBehavior.js';
5
+ export * from './ISYClusterBehavior.js';
6
+ export * from './Insteon/index.js';
@@ -12,6 +12,7 @@ import { ISY } from '../../ISY.js';
12
12
  import type { ISYNode } from '../../ISYNode.js';
13
13
 
14
14
  import '../Mappings/index.js';
15
+ import '../Behaviors/Insteon/index.js';
15
16
  import { MappingRegistry } from '../Mappings/MappingRegistry.js';
16
17
  import { DimmerLevelControlBehavior } from '../Behaviors/Insteon/DimmerLevelControlBehavior.js';
17
18
  import { RelayOnOffBehavior } from '../Behaviors/Insteon/index.js';
@@ -237,7 +238,7 @@ export async function createMatterServer(isy?: ISY, config?: Config): Promise<Se
237
238
  let b = BehaviorRegistry.get(device,behavior.cluster.name);
238
239
  if(b)
239
240
  {
240
- baseBehavior = deviceType.with(b);
241
+ baseBehavior = baseBehavior.with(b);
241
242
  }
242
243
  }
243
244
  }
@@ -1 +1,3 @@
1
- import './Insteon.js';
1
+ import './Insteon.js';
2
+ import './MappingRegistry.js';
3
+