isy-nodejs 1.0.4-alpha.1 → 1.0.5-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 (39) hide show
  1. package/dist/esm/Devices/Insteon/InsteonDeviceFactory.js.map +1 -1
  2. package/dist/esm/Devices/Insteon/InsteonDimmableDevice.js.map +1 -1
  3. package/dist/esm/Devices/Insteon/InsteonDimmerOutletDevice.js +2 -2
  4. package/dist/esm/Devices/Insteon/InsteonDimmerOutletDevice.js.map +1 -1
  5. package/dist/esm/Devices/Insteon/index.js +4 -1
  6. package/dist/esm/Devices/Insteon/index.js.map +1 -1
  7. package/dist/esm/Matter/Bridge/Server.js +9 -11
  8. package/dist/esm/Matter/Bridge/Server.js.map +1 -1
  9. package/dist/esm/Matter/Mappings/Insteon.js +5 -3
  10. package/dist/esm/Matter/Mappings/Insteon.js.map +1 -1
  11. package/dist/esm/Matter/Mappings/index.js +2 -0
  12. package/dist/esm/Matter/Mappings/index.js.map +1 -0
  13. package/dist/esm/types/Devices/EndpointFor.d.ts +1 -1
  14. package/dist/esm/types/Devices/Insteon/InsteonDevice.d.ts +2 -2
  15. package/dist/esm/types/Devices/Insteon/InsteonDeviceFactory.d.ts.map +1 -1
  16. package/dist/esm/types/Devices/Insteon/InsteonDimmableDevice.d.ts +1 -1
  17. package/dist/esm/types/Devices/Insteon/InsteonDimmableDevice.d.ts.map +1 -1
  18. package/dist/esm/types/Devices/Insteon/InsteonDimmerOutletDevice.d.ts +2 -2
  19. package/dist/esm/types/Devices/Insteon/InsteonDimmerOutletDevice.d.ts.map +1 -1
  20. package/dist/esm/types/Devices/Insteon/index.d.ts +3 -1
  21. package/dist/esm/types/Devices/Insteon/index.d.ts.map +1 -1
  22. package/dist/esm/types/ISYNode.d.ts +1 -1
  23. package/dist/esm/types/ISYNode.d.ts.map +1 -1
  24. package/dist/esm/types/Matter/Bridge/Server.d.ts +1 -1
  25. package/dist/esm/types/Matter/Bridge/Server.d.ts.map +1 -1
  26. package/dist/esm/types/Matter/Mappings/Insteon.d.ts.map +1 -1
  27. package/dist/esm/types/Matter/Mappings/index.d.ts +2 -0
  28. package/dist/esm/types/Matter/Mappings/index.d.ts.map +1 -0
  29. package/dist/esm/types/Model/EnumDefinition.d.ts +1 -1
  30. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  31. package/package.json +2 -2
  32. package/src/Devices/Insteon/InsteonDeviceFactory.ts +1 -0
  33. package/src/Devices/Insteon/InsteonDimmableDevice.ts +3 -7
  34. package/src/Devices/Insteon/InsteonDimmerOutletDevice.ts +2 -2
  35. package/src/Devices/Insteon/index.ts +9 -19
  36. package/src/Matter/Bridge/Server.ts +14 -27
  37. package/src/Matter/Mappings/Insteon.ts +11 -3
  38. package/src/Matter/Mappings/index.ts +1 -0
  39. package/src/Matter/Mappings/register.ts +0 -0
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.4-alpha.1",
5
+ "version": "1.0.5-alpha.1",
6
6
  "author": {
7
7
  "name": "Pradeep Mouli"
8
8
  },
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "25bc1f98e239376a78bf7e78b852a5c25e2b964f"
76
+ "gitHead": "098727cb35d99e11fcbad8026cd2f32ebcfacc29"
77
77
  }
@@ -2,6 +2,7 @@ import { Category } from '../../Definitions/Global/Categories.js';
2
2
 
3
3
  import { parseTypeCode } from '../../Utils.js';
4
4
  import { NodeInfo } from '../../Model/NodeInfo.js';
5
+ import * as Insteon from './index.js';
5
6
  import { InsteonDimmableDevice } from './InsteonDimmableDevice.js';
6
7
  import { InsteonDimmerOutletDevice } from './InsteonDimmerOutletDevice.js';
7
8
  import { InsteonDimmerSwitchDevice } from './InsteonDimmerSwitchDevice.js';
@@ -1,15 +1,11 @@
1
- import { Identity } from '@project-chip/matter.js/util';
2
- import { ISY } from '../../ISY.js';
1
+ import type { ISY } from '../../ISY.js';
2
+
3
3
 
4
4
 
5
- import { InsteonRelayDevice } from './InsteonRelayDevice.js';
6
5
  //
7
6
  import type { DimmableLightRequirements } from '@project-chip/matter.js/devices/DimmableLightDevice';
8
- import { ClusterBehavior } from '@project-chip/matter.js/behavior/cluster';
9
- import { OnOffBehavior as OOB, OnOffInterface } from '@project-chip/matter.js/behaviors/on-off';
10
- import { OnOff, ClusterType } from '@project-chip/matter.js/cluster';
7
+ import { OnOffBehavior as OOB } from '@project-chip/matter.js/behaviors/on-off';
11
8
  import 'winston';
12
- import { UnitOfMeasure } from '../../Definitions/Global/UOM.js';
13
9
  import type { NodeInfo } from '../../Model/NodeInfo.js';
14
10
  import { DimmerLampSwitchNode } from './Generated/DimmerLampSwitch.js';
15
11
 
@@ -1,8 +1,8 @@
1
1
  import type { NodeInfo } from '../../Model/NodeInfo.js';
2
2
  import type { ISY } from '../../ISY.js';
3
- import { InsteonDimmableDevice } from './InsteonDimmableDevice.js';
3
+ import { DimmerLampNode } from './Generated/DimmerLamp.js';
4
4
 
5
- export class InsteonDimmerOutletDevice extends InsteonDimmableDevice {
5
+ export class InsteonDimmerOutletDevice extends DimmerLampNode {
6
6
  constructor (isy: ISY, deviceNode: NodeInfo) {
7
7
  super(isy, deviceNode);
8
8
  }
@@ -1,23 +1,16 @@
1
- import { InsteonLeakSensorDevice } from "./InsteonLeakSensorDevice.js";
1
+
2
2
  //import Base from "./InsteonBaseDevice.js"
3
- import { InsteonLockDevice } from "./InsteonLockDevice.js";
4
- import { InsteonFanDevice } from "./InsteonFanDevice.js";
5
- import { InsteonRelayDevice } from "./InsteonRelayDevice.js";
6
- import { InsteonDimmableDevice } from "./InsteonDimmableDevice.js";
7
- import { InsteonKeypadDimmerDevice } from "./InsteonKeypadDimmerDevice.js";
8
- import { InsteonMotionSensorDevice } from "./InsteonMotionSensorDevice.js";
9
- import { InsteonDimmerSwitchDevice } from "./InsteonDimmerSwitchDevice.js";
10
- import { InsteonSmokeSensorDevice } from "./InsteonSmokeSensorDevice.js";
11
- import { InsteonDimmerOutletDevice } from "./InsteonDimmerOutletDevice.js";
12
- import { InsteonRelaySwitchDevice } from "./InsteonRelaySwitchDevice.js";
13
- import { InsteonThermostatDevice } from "./InsteonThermostatDevice.js";
14
- import { InsteonDoorWindowSensorDevice } from './InsteonDoorWindowSensorDevice.js';
15
-
16
- import { ISYNode } from '../../ISYNode.js';
17
- import type * as GeneratedTypes from "./Generated/index.js";
3
+
4
+
18
5
 
19
6
  export {InsteonBaseDevice as Base} from "./InsteonBaseDevice.js";
20
7
 
8
+ export * from './Generated/index.js';
9
+
10
+ export {InsteonDimmableDevice as Dimmable} from "./InsteonDimmableDevice.js";
11
+
12
+ export {InsteonRelayDevice as Relay} from "./InsteonRelayDevice.js";
13
+
21
14
  export {InsteonLeakSensorDevice as LeakSensor} from "./InsteonLeakSensorDevice.js";
22
15
 
23
16
  export {InsteonMotionSensorDevice as MotionSensor} from "./InsteonMotionSensorDevice.js";
@@ -38,6 +31,3 @@ export {InsteonDimmerOutletDevice as DimmerOutlet} from "./InsteonDimmerOutletDe
38
31
  Lock: InsteonLockDevice,
39
32
  Fan: InsteonFanDevice,
40
33
  ...Generated */
41
-
42
-
43
- export * from './Generated/index.js';
@@ -1,32 +1,19 @@
1
- import { Endpoint, EndpointServer, Environment, MutableEndpoint, ServerNode, StorageService, Time, VendorId, type SupportedBehaviors } from '@matter/main';
2
- import { StorageBackendDisk } from '@project-chip/matter-node.js/storage';
3
- import { BridgedDeviceBasicInformationServer, type BridgedDeviceBasicInformationBehavior } from '@project-chip/matter.js/behaviors/bridged-device-basic-information';
4
- import { logEndpoint } from '@matter/main/protocol';
5
- import { DimmableLightDevice, OnOffLightDevice } from '@matter/main/devices';
1
+ import { LogLevel, logLevelFromString, Logger as MatterLogger } from '@matter/general';
2
+ import { Endpoint, EndpointServer, Environment, MutableEndpoint, ServerNode, StorageService, VendorId } from '@matter/main';
6
3
  import { AggregatorEndpoint } from '@matter/main/endpoints/aggregator';
7
- import { LogLevel, logLevelFromString, Logger as MatterLogger, toHex } from '@matter/general';
8
- import { Devices } from '../../Devices/index.js';
9
- //@ts-ignore
4
+ import { logEndpoint } from '@matter/main/protocol';
10
5
  import PackageJson from '@project-chip/matter.js/package.json' with { type: 'json' };
11
- import { QrCode } from '@project-chip/matter.js/schema';
12
- import path, { resolve } from 'path';
6
+ import path from 'path';
13
7
  import { format, loggers } from 'winston';
14
8
  import { ISYDeviceNode } from '../../Devices/ISYDeviceNode.js';
15
9
  import { ISY } from '../../ISY.js';
16
- import { ISYBridgedDeviceBehavior } from '../Behaviors/ISYBridgedDeviceBehavior.js';
17
- import { ISYDimmableBehavior, ISYOnOffBehavior } from '../Behaviors/Insteon/ISYOnOffBehavior.js';
18
- import '../Mappings/Insteon.js';
19
10
  import type { ISYNode } from '../../ISYNode.js';
20
-
21
- import { Options } from '../../Definitions/ZWave/index.js';
22
- import { InsteonBaseDevice } from '../../Devices/Insteon/InsteonBaseDevice.js';
23
- import { DimmerLamp } from '../../Devices/Insteon/Generated/DimmerLamp.js';
24
- import { Family } from '../../Definitions/index.js';
25
- import { RelayLamp } from '../../Devices/Insteon/index.js';
26
- import type { DeviceTypeDefinition } from '@project-chip/matter.js/device';
11
+ import { ISYDimmableBehavior, ISYOnOffBehavior } from '../Behaviors/Insteon/ISYOnOffBehavior.js';
12
+ import '../Mappings/index.js';
13
+ import { RelayLamp, DimmerLamp } from '../../Devices/Insteon/index.js';
27
14
  import { MappingRegistry } from '../Mappings/MappingRegistry.js';
28
- import type { BridgedISYNodeInformationServer } from '../../Devices/EndpointFor.js';
29
- import { BasicInformation } from '@project-chip/matter.js/cluster';
15
+ import { QrCode } from '@matter/main/types';
16
+
30
17
 
31
18
 
32
19
  // #region Interfaces (1)
@@ -57,7 +44,7 @@ export interface Config {
57
44
  }
58
45
 
59
46
  export interface DeviceOptions {
60
- applyTo:
47
+ applyTo:
61
48
  | {
62
49
  classes: (typeof ISYNode<any, any, any, any>)[];
63
50
  }
@@ -276,9 +263,9 @@ export async function createMatterServer(isy?: ISY, config?: Config): Promise<Se
276
263
  softwareVersion: Number(device.version),
277
264
  softwareVersionString: `v.${device.version}`,
278
265
 
279
- serialNumber: device.address,
266
+ serialNumber: uniqueId,
280
267
  reachable: true,
281
- uniqueId: uniqueId
268
+ uniqueId: device.address
282
269
 
283
270
  },
284
271
 
@@ -366,8 +353,8 @@ async function initializeConfiguration(isy: ISY, config?: Config): Promise<Confi
366
353
  storageService.location = storagePath;
367
354
  });
368
355
 
369
- storageService.factory = (namespace) => new StorageBackendDisk(path.resolve(storageService.location ?? '.', namespace), environment.vars.get('storage.clear', false));
370
356
  logger.info(`Matter storage location: ${storageService.location} (Directory)`);
357
+ logger.info(`Matter storage service type: ${storageService.factory.name}`);
371
358
 
372
359
  const deviceStorage = (await storageService.open('bridge')).createContext('data');
373
360
 
@@ -390,7 +377,7 @@ async function initializeConfiguration(isy: ISY, config?: Config): Promise<Confi
390
377
 
391
378
  environment.vars.set('uniqueid', isy.id.replaceAll(':', '_'));
392
379
 
393
-
380
+ //logger.info(`Matter configuration: ${JSON.stringify(environment.vars)}`);
394
381
 
395
382
  const vendorName = isy.vendorName;
396
383
  const passcode = environment.vars.number('passcode') ?? (await deviceStorage.get('passcode', 20202021));
@@ -44,11 +44,12 @@ export const map: FamilyToClusterMap<Family.Insteon> = {
44
44
  },
45
45
  commands: { on: 'DON' }
46
46
  },
47
+ //@ts-ignore
47
48
  LevelControl: {
48
49
  // @ts-ignore
49
50
  attributes: {
50
51
  currentLevel: { driver: 'ST', converter: 'Percent.LightingLevel' },
51
- startUpCurrentLevel: { driver: 'OL', converter: 'Percent.LightingLevel' },
52
+ //startUpCurrentLevel: { driver: 'OL', converter: 'Percent.LightingLevel' },
52
53
  onLevel: { driver: 'OL', converter: 'Percent.LightingLevel' }
53
54
  },
54
55
  commands: { setLevel: { command: 'DON' } }
@@ -67,11 +68,12 @@ export const map: FamilyToClusterMap<Family.Insteon> = {
67
68
  commands: { on: 'DON' }
68
69
  },
69
70
  LevelControl: {
70
- // @ts-ignore
71
+
71
72
  attributes: {
72
73
  currentLevel: { driver: 'ST', converter: 'Percent.LightingLevel' },
73
- startUpCurrentLevel: { driver: 'OL', converter: 'Percent.LightingLevel' },
74
+ //startUpCurrentLevel: { driver: 'OL', converter: 'Percent.LightingLevel' },
74
75
  onLevel: { driver: 'OL', converter: 'Percent.LightingLevel' }
76
+
75
77
  },
76
78
  commands: { setLevel: { command: 'DON' } }
77
79
  }
@@ -79,6 +81,12 @@ export const map: FamilyToClusterMap<Family.Insteon> = {
79
81
  }
80
82
  };
81
83
 
84
+ map.KeypadDimmer = map.DimmerLamp;
85
+ map.KeypadRelay = map.RelayLampSwitch;
86
+
87
+
88
+
89
+
82
90
  /*let newMap = add(map, Insteon.DimmerLamp.Node, {
83
91
  deviceType: DimmableLightDevice,
84
92
  // @ts-ignore
@@ -0,0 +1 @@
1
+ import './Insteon.js';
File without changes