isy-nodejs 1.0.5-alpha.0 → 1.0.6-alpha.0
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.
- package/dist/esm/ISYDevice.js.map +1 -1
- package/dist/esm/Matter/Bridge/Server.js +9 -11
- package/dist/esm/Matter/Bridge/Server.js.map +1 -1
- package/dist/esm/Matter/Mappings/Insteon.js +5 -3
- package/dist/esm/Matter/Mappings/Insteon.js.map +1 -1
- package/dist/esm/Matter/Mappings/index.js +2 -0
- package/dist/esm/Matter/Mappings/index.js.map +1 -0
- package/dist/esm/types/ISYDevice.d.ts.map +1 -1
- package/dist/esm/types/Matter/Bridge/Server.d.ts +1 -1
- package/dist/esm/types/Matter/Bridge/Server.d.ts.map +1 -1
- package/dist/esm/types/Matter/Mappings/Insteon.d.ts.map +1 -1
- package/dist/esm/types/Matter/Mappings/index.d.ts +2 -0
- package/dist/esm/types/Matter/Mappings/index.d.ts.map +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/ISYDevice.ts +0 -4
- package/src/Matter/Bridge/Server.ts +14 -27
- package/src/Matter/Mappings/Insteon.ts +11 -3
- package/src/Matter/Mappings/index.ts +1 -0
- 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.
|
|
5
|
+
"version": "1.0.6-alpha.0",
|
|
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": "
|
|
76
|
+
"gitHead": "5d625f624978b697bd1212a415587fee331d713d"
|
|
77
77
|
}
|
package/src/ISYDevice.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import type { Command } from './Definitions/Global/Commands.js';
|
|
2
2
|
import type { Driver } from './Definitions/Global/Drivers.js';
|
|
3
|
-
import type { UnitOfMeasure } from './Definitions/Global/UOM.js';
|
|
4
3
|
import type { Category, Family } from './Definitions/index.js';
|
|
5
4
|
import { ISYDeviceNode } from './Devices/ISYDeviceNode.js';
|
|
6
|
-
import type { ISY } from './ISY.js';
|
|
7
5
|
import type { ISYNode } from './ISYNode.js';
|
|
8
6
|
import type { ISYScene } from './ISYScene.js';
|
|
9
|
-
import type { DriverState } from './Model/DriverState.js';
|
|
10
|
-
import type { StringKeys } from './Utils.js';
|
|
11
7
|
|
|
12
8
|
export interface ISYDevice<T extends Family, D extends ISYNode.DriverSignatures, C extends ISYNode.CommandSignatures, E extends ISYNode.EventSignatures> extends ISYDeviceInfo {
|
|
13
9
|
// #region Properties (22)
|
|
@@ -1,32 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 {
|
|
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
|
|
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
|
|
22
|
-
import {
|
|
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
|
|
29
|
-
|
|
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
|
-
|
|
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:
|
|
266
|
+
serialNumber: uniqueId,
|
|
280
267
|
reachable: true,
|
|
281
|
-
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
|
-
|
|
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
|