isy-nodejs 1.0.1-alpha.19 → 1.0.1-alpha.20

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/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.19",
5
+ "version": "1.0.1-alpha.20",
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": "e12b10c35ca86c8e6a2ffa9a286ffefff8ce3677"
72
+ "gitHead": "3b8710c1b6a783c32744c2f97f56ba8b836b02ca"
73
73
  }
package/src/ISY.ts CHANGED
@@ -792,7 +792,7 @@ export class ISY extends EventEmitter implements Disposable {
792
792
  this.logger.info('Loading Folder Nodes');
793
793
  if (result?.nodes?.folder) {
794
794
  for (const folder of result.nodes.folder) {
795
- this.logger.info(`Loading Folder Node: ${JSON.stringify(folder)}`);
795
+ this.logger.debug(`Loading Folder Node: ${JSON.stringify(folder)}`);
796
796
  this.folderMap.set(folder.address, folder.name);
797
797
  }
798
798
  }
package/src/ISYNode.ts CHANGED
@@ -106,7 +106,7 @@ export class ISYNode<
106
106
  .trim();
107
107
  if (this.parentType === NodeType.Folder) {
108
108
  this.folder = isy.folderMap.get(this.parent._);
109
- isy.logger.info(`${this.name} this node is in folder ${this.folder}`);
109
+ isy.logger.debug(`${this.name} is in folder ${this.folder}`);
110
110
  this.logger = (msg: any, level: keyof CliConfigSetLevels = 'debug', ...meta: any[]) => {
111
111
  isy.logger[level](`${this.folder} ${this.name} (${this.address}): ${msg}`, meta);
112
112
  return isy.logger;
@@ -219,7 +219,7 @@ export class ISYNode<
219
219
 
220
220
  public async getNotes(): Promise<NodeNotes> {
221
221
  try {
222
- const result = await this.isy.sendRequest(`nodes/${this.address}/notes`,{trailingSlash: false,errorLogLevel: 'debug'});
222
+ const result = await this.isy.sendRequest(`nodes/${this.address}/notes`, { trailingSlash: false, errorLogLevel: 'debug' });
223
223
  if (result !== null && result !== undefined) {
224
224
  return result.NodeProperties;
225
225
  } else {
@@ -12,15 +12,16 @@ import { AggregatorEndpoint } from '@project-chip/matter.js/endpoints/Aggregator
12
12
  import { StorageService } from '@project-chip/matter.js/environment';
13
13
  import { Level, levelFromString, Logger as MatterLogger } from '@project-chip/matter.js/log';
14
14
  import { ServerNode } from '@project-chip/matter.js/node';
15
- import PackageJson from '@project-chip/matter.js/package.json';
15
+ //@ts-ignore
16
+ import PackageJson from '@project-chip/matter.js/package.json' with { type: 'json' };
16
17
  import { QrCode } from '@project-chip/matter.js/schema';
17
18
  import path, { resolve } from 'path';
19
+ import { format, loggers } from 'winston';
18
20
  import type { ISYDeviceNode } from '../../Devices/ISYDeviceNode.js';
19
21
  import { InsteonDimmableDevice, InsteonKeypadButtonDevice, InsteonRelayDevice, ISY } from '../../ISY.js';
20
22
  import { ISYBridgedDeviceBehavior } from '../Behaviors/ISYBridgedDeviceBehavior.js';
21
23
  import { ISYDimmableBehavior, ISYOnOffBehavior } from '../Behaviors/ISYOnOffBehavior.js';
22
24
  import '../Mappings/Insteon.js';
23
- import { format, loggers } from 'winston';
24
25
 
25
26
  // #region Interfaces (1)
26
27
 
@@ -51,13 +52,12 @@ export function create(isy?: ISY, config?: Config): Promise<ServerNode> {
51
52
  return createMatterServer(isy, config);
52
53
  }
53
54
 
54
-
55
55
  export async function createMatterServer(isy?: ISY, config?: Config): Promise<ServerNode> {
56
56
  var logger = loggers.add('matter', {
57
- transports: isy.logger.transports,
58
- levels: isy.logger.levels,
59
- format: format.label({ label: 'Matter' })
60
- });
57
+ transports: isy.logger.transports,
58
+ levels: isy.logger.levels,
59
+ format: format.label({ label: 'Matter' })
60
+ });
61
61
  if (isy === undefined) {
62
62
  isy = ISY.instance;
63
63
  }
package/src/Utils.ts CHANGED
@@ -11,11 +11,11 @@ import { Category } from './Definitions/Global/Categories.js';
11
11
  import type { PackageJson } from '@npmcli/package-json';
12
12
  import type { Identity } from '@project-chip/matter.js/util';
13
13
  import { existsSync } from 'fs';
14
+ import { readFile } from 'fs/promises';
14
15
  import path from 'path';
15
16
  import { isBoxedPrimitive } from 'util/types';
16
17
  import { Family, type Driver, type DriverType, type EnumLiteral } from './Definitions/index.js';
17
18
  import { EventType } from './Events/EventType.js';
18
- import { readFile } from 'fs/promises';
19
19
 
20
20
  export type StringKeys<T> = Extract<keyof T, string>;
21
21
 
@@ -287,9 +287,8 @@ export async function findPackageJson(currentPath: string = getImportMeta().dirn
287
287
  currentPath = path.join(currentPath, '..');
288
288
  }
289
289
  } catch {
290
-
291
290
  //@ts-expect-error
292
- return (await import ('package.json')).default;
291
+ return (await import('../../package.json')).default;
293
292
  }
294
293
  return null;
295
294
  }