homebridge-smartsystem 6.4.1 → 6.4.2

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
@@ -459,7 +459,7 @@ export class Master extends Base {
459
459
 
460
460
  // if logged in, ask protocol version
461
461
  if (this.isLoggedIn) {
462
- this.send(Protocol.buildRequestNodeMgt(reqNodeAttributes.nodeProtocol));
462
+ this.send(Protocol.buildRequestNodeMgt(reqNodeAttributes.nodeVersion));
463
463
  }
464
464
 
465
465
  } else {
@@ -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,11 +818,11 @@ export class Master extends Base {
820
818
  }
821
819
 
822
820
  async requestRegisterValue(register: number) {
823
- if (this.version >= 209) {
821
+ if (this.version >= 6609) {
824
822
  await this.send(Protocol.buildRegister(register));
825
823
  this.info("request register: " + register);
826
824
  } else {
827
- this.err("FC_REGISTERMAP not available before protocol v2.09")
825
+ this.err("FC_REGISTERMAP not available before firmware v66.09")
828
826
  }
829
827
  }
830
828
 
@@ -839,11 +837,11 @@ 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.version >= 6609) {
843
841
  await this.send(Protocol.buildRegister(register, value));
844
842
  this.info("set register: " + register + ", to: " + value);
845
843
  } else {
846
- this.err("FC_REGISTERMAP not available before protocol v2.09")
844
+ this.err("FC_REGISTERMAP not available before firmware v66.09")
847
845
  }
848
846
  }
849
847
 
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.2",
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",
@@ -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.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") debug("somfy", e);
170
172
  init = false;
171
173
  busy = false;
172
174
  });