homebridge-smartsystem 6.4.1 → 6.4.3

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/README.md CHANGED
@@ -285,6 +285,7 @@ Homebridge UI version
285
285
  ### v6.4.x - 28-11-2022 - Binding to registers
286
286
  - 0: writing to registers
287
287
  - 1: ask/show protocol version -> publish
288
+ - 2: test on firmware version, not protocol for using registers, due to bug in master firmware pre v101.x
288
289
 
289
290
  ## Hardware
290
291
  A Raspberry Pi that connects to a Duotecno IP Node
@@ -412,7 +412,7 @@ class Master extends base_1.Base {
412
412
  this.resolveLogin = null;
413
413
  // if logged in, ask protocol version
414
414
  if (this.isLoggedIn) {
415
- this.send(protocol_1.Protocol.buildRequestNodeMgt(protocol_1.reqNodeAttributes.nodeProtocol));
415
+ this.send(protocol_1.Protocol.buildRequestNodeMgt(protocol_1.reqNodeAttributes.nodeVersion));
416
416
  }
417
417
  }
418
418
  else {
@@ -434,16 +434,14 @@ class Master extends base_1.Base {
434
434
  this.log("NodeMgtInfo - master " + this.getName() + " can be master: " + message[2]);
435
435
  }
436
436
  else if (message[1] === protocol_1.reqNodeAttributes.nodeVersion) {
437
- console.log("*** -> " + message);
438
437
  this.log("NodeMgtInfo - version " + this.getName() + ", version: " + message[2] + "." + message[3]);
439
438
  this.version = message[2] * 100 + message[3];
440
- //BUG - TODO: remove
441
- this.protocol = message[2] * 100 + message[3];
439
+ console.log("*** version -> " + message + " -> " + this.version + " ***");
442
440
  }
443
441
  else if (message[1] === protocol_1.reqNodeAttributes.nodeProtocol) {
444
- console.log("*** -> " + message);
445
442
  this.log("NodeMgtInfo - protocol " + this.getName() + ", protocol: " + message[2] + "." + message[3]);
446
443
  this.protocol = message[2] * 100 + message[3];
444
+ console.log("*** protocol -> " + message + " -> " + this.protocol + " ***");
447
445
  }
448
446
  else {
449
447
  this.err("dropped NodeMgtInfo info message = " + message[1] + ", message: " + message);
@@ -753,12 +751,12 @@ class Master extends base_1.Base {
753
751
  }
754
752
  requestRegisterValue(register) {
755
753
  return __awaiter(this, void 0, void 0, function* () {
756
- if (this.version >= 209) {
754
+ if (this.version >= 6609) {
757
755
  yield this.send(protocol_1.Protocol.buildRegister(register));
758
756
  this.info("request register: " + register);
759
757
  }
760
758
  else {
761
- this.err("FC_REGISTERMAP not available before protocol v2.09");
759
+ this.err("FC_REGISTERMAP not available before firmware v66.09");
762
760
  }
763
761
  });
764
762
  }
@@ -775,12 +773,12 @@ class Master extends base_1.Base {
775
773
  }
776
774
  setRegisterValue(register, value) {
777
775
  return __awaiter(this, void 0, void 0, function* () {
778
- if (this.version >= 209) {
776
+ if (this.version >= 6609) {
779
777
  yield this.send(protocol_1.Protocol.buildRegister(register, value));
780
778
  this.info("set register: " + register + ", to: " + value);
781
779
  }
782
780
  else {
783
- this.err("FC_REGISTERMAP not available before protocol v2.09");
781
+ this.err("FC_REGISTERMAP not available before firmware v66.09");
784
782
  }
785
783
  });
786
784
  }
@@ -483,16 +483,14 @@ export class Master extends Base {
483
483
  this.log("NodeMgtInfo - master " + this.getName() + " can be master: " + message[2]);
484
484
 
485
485
  } else if (message[1] === reqNodeAttributes.nodeVersion) {
486
- console.log("*** -> " + message);
487
486
  this.log("NodeMgtInfo - version " + this.getName() + ", version: " + message[2] + "." + message[3]);
488
487
  this.version = message[2] * 100 + message[3];
489
- //BUG - TODO: remove
490
- this.protocol = message[2] * 100 + message[3];
488
+ console.log("*** version -> " + message + " -> " + this.version + " ***");
491
489
 
492
490
  } else if (message[1] === reqNodeAttributes.nodeProtocol) {
493
- console.log("*** -> " + message);
494
491
  this.log("NodeMgtInfo - protocol " + this.getName() + ", protocol: " + message[2] + "." + message[3]);
495
492
  this.protocol = message[2] * 100 + message[3];
493
+ console.log("*** protocol -> " + message + " -> " + this.protocol + " ***");
496
494
 
497
495
 
498
496
  } else {
@@ -820,7 +818,7 @@ export class Master extends Base {
820
818
  }
821
819
 
822
820
  async requestRegisterValue(register: number) {
823
- if (this.version >= 209) {
821
+ if (this.protocol >= 209) {
824
822
  await this.send(Protocol.buildRegister(register));
825
823
  this.info("request register: " + register);
826
824
  } else {
@@ -839,7 +837,7 @@ export class Master extends Base {
839
837
  }
840
838
 
841
839
  async setRegisterValue(register: number, value: number) {
842
- if (this.version >= 209) {
840
+ if (this.protocol >= 209) {
843
841
  await this.send(Protocol.buildRegister(register, value));
844
842
  this.info("set register: " + register + ", to: " + value);
845
843
  } else {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-smartsystem",
3
3
  "displayname": "Duotecno Bridge",
4
- "version": "6.4.1",
4
+ "version": "6.4.3",
5
5
  "description": "SmartServer (Proxy Websockets to TCP sockets, Smappee MQTT, Duotecno IP Nodes, Homekit interface)",
6
6
  "main": "index.js",
7
7
  "author": "Johan Coppieters",
@@ -249,7 +249,7 @@ class PowerBase extends base_1.Base {
249
249
  //
250
250
  updateBindings() {
251
251
  // sort on channel.
252
- this.bindings.sort((a, b) => parseInt(a.channel) - parseInt(b.channel));
252
+ this.bindings.sort((a, b) => a.register - b.register);
253
253
  // sanitize and copy all rules into the config
254
254
  this.config.bindings = this.bindings.map(b => types_1.Sanitizers.bindingConfig(b));
255
255
  (0, logger_1.debug)("power", "config.bindings = " + JSON.stringify(this.config.bindings));
@@ -285,7 +285,7 @@ export class PowerBase extends Base {
285
285
  //
286
286
  updateBindings() {
287
287
  // sort on channel.
288
- this.bindings.sort((a,b) => parseInt(a.channel)-parseInt(b.channel));
288
+ this.bindings.sort((a,b) => a.register-b.register);
289
289
 
290
290
  // sanitize and copy all rules into the config
291
291
  this.config.bindings = this.bindings.map(b => Sanitizers.bindingConfig(b));
package/server/somfy.js CHANGED
@@ -171,8 +171,9 @@ setup().then(() => {
171
171
  init = true;
172
172
  busy = false;
173
173
  }).catch((e) => {
174
- (0, logger_1.debug)("somfy", "error setting up gpio package - running test mode");
175
- (0, logger_1.debug)("somfy", e);
174
+ (0, logger_1.debug)("somfy", "gpio package not initialized");
175
+ if (e.code != "EACCES")
176
+ (0, logger_1.debug)("somfy", e);
176
177
  init = false;
177
178
  busy = false;
178
179
  });
package/server/somfy.ts CHANGED
@@ -160,13 +160,15 @@ export async function stop(screen: number): Promise<boolean> {
160
160
  // }
161
161
 
162
162
  busy = true;
163
+
163
164
  setup().then(() => {
164
165
  debug("somfy", "gpio package initialized");
165
166
  init = true;
166
167
  busy = false;
168
+
167
169
  }).catch((e) => {
168
- debug("somfy", "error setting up gpio package - running test mode");
169
- debug("somfy", e);
170
+ debug("somfy", "gpio package not initialized");
171
+ if ((e.code != "EACCES") && (e.code != "ENOENT")) debug("somfy", e);
170
172
  init = false;
171
173
  busy = false;
172
174
  });