isy-nodejs 1.0.1-alpha.21 → 1.0.1-alpha.22

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.21",
5
+ "version": "1.0.1-alpha.22",
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": "076f31525fee4046130d78c9b7a115c10a32c5c2"
72
+ "gitHead": "58d143722781c7f2388e90af3b69eb112bc190ed"
73
73
  }
package/src/ISY.ts CHANGED
@@ -561,9 +561,16 @@ export class ISY extends EventEmitter implements Disposable {
561
561
  let uriToUse = `nodes/${node.address}/cmd/${command}`;
562
562
  if (parameters !== null && parameters !== undefined) {
563
563
  if (typeof parameters == 'object') {
564
+
564
565
  var q = parameters as Record<P, string | number>;
565
566
  for (const paramName of Object.getOwnPropertyNames(q)) {
566
- uriToUse += `/${paramName}/${q[paramName]}`;
567
+ if(paramName === 'value')
568
+ {
569
+ uriToUse += `/${q[paramName]}`;
570
+ continue;
571
+ }
572
+ if(typeof q[paramName] === 'string' || typeof q[paramName] === 'number')
573
+ uriToUse += `/${paramName}/${q[paramName]}`;
567
574
  }
568
575
 
569
576
  //uriToUse += `/${q[((p : Record<string,number|number>) => `${p[]}/${p.paramValue}` ).join('/')}`;
@@ -58,9 +58,9 @@ export class ISYDimmableBehavior extends ISYClusterBehavior(DimmableLightRequire
58
58
  override setLevel(level: number): MaybePromise<void> {
59
59
  level = Converter.Matter.LevelFrom0To255.LightingLevel.from(level);
60
60
  if (level > 0) {
61
- return this.device.sendCommand('DON', level);
61
+ return this.device.on();
62
62
  } else {
63
- return this.device.sendCommand('DOF');
63
+ return this.device.off();
64
64
  }
65
65
  }
66
66
  }