homebridge-smartsystem 6.2.3 → 6.2.4

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
@@ -272,6 +272,7 @@ Homebridge UI version
272
272
  - 1: always write config to file too (next to sending through the HB-UI API)
273
273
  - 2: added headers to http calls from switches, dimmers and up/down's (including OH stuff)
274
274
  - 3: fixed bug in Sanitizer of UnitConfig preventing from publishing units to homebridge
275
+ - 4: fixed empty name bug in unit-def / new accessory()
275
276
 
276
277
 
277
278
  ## Hardware
@@ -9,9 +9,9 @@ const logger_1 = require("../duotecno/logger");
9
9
  class Accessory {
10
10
  constructor(api, unit) {
11
11
  this.homebridge = api.hap;
12
- this.unit = unit; // : Duotecno Unit
13
- this.name = unit.getDisplayName();
14
12
  this.uuid_base = unit.getSerialNr();
13
+ this.unit = unit; // : Duotecno Unit
14
+ this.name = unit.getDisplayName() || this.uuid_base;
15
15
  // get all services and add ours
16
16
  this.services = this.getAccessoryServices();
17
17
  this.services.push(this.getInformationService());
@@ -33,10 +33,10 @@ class Accessory {
33
33
  throw new Error('The getSystemServices method must be overridden.');
34
34
  }
35
35
  getModelName() {
36
- return this.name;
36
+ return this.name || this.unit.getSerialNr();
37
37
  }
38
38
  getName() {
39
- return this.name;
39
+ return this.name || this.unit.getSerialNr();
40
40
  }
41
41
  getSerialNumber() {
42
42
  if (this.unit)
@@ -18,9 +18,10 @@ export class Accessory {
18
18
 
19
19
  constructor(api: API, unit: Unit) {
20
20
  this.homebridge = api.hap;
21
- this.unit = unit; // : Duotecno Unit
22
- this.name = unit.getDisplayName();
21
+
23
22
  this.uuid_base = unit.getSerialNr();
23
+ this.unit = unit; // : Duotecno Unit
24
+ this.name = unit.getDisplayName() || this.uuid_base;
24
25
 
25
26
  // get all services and add ours
26
27
  this.services = this.getAccessoryServices();
@@ -47,10 +48,10 @@ export class Accessory {
47
48
  }
48
49
 
49
50
  getModelName(): string {
50
- return this.name;
51
+ return this.name || this.unit.getSerialNr();
51
52
  }
52
53
  getName(): string {
53
- return this.name;
54
+ return this.name || this.unit.getSerialNr();
54
55
  }
55
56
 
56
57
  getSerialNumber(): string {
package/duotecno/types.js CHANGED
@@ -373,7 +373,10 @@ exports.Sanitizers = {
373
373
  logicalNodeAddress: info.logicalNodeAddress || 0,
374
374
  logicalAddress: info.logicalAddress || 0,
375
375
  masterAddress: info.masterAddress || '',
376
- masterPort: info.masterPort || 5001
376
+ masterPort: info.masterPort || 5001,
377
+ name: info.name || ('unit ' + info.logicalNodeAddress + ":" + info.logicalAddress),
378
+ displayName: info.displayName || ('unit ' + info.logicalNodeAddress + ":" + info.logicalAddress),
379
+ extendedType: info.extendedType
377
380
  };
378
381
  },
379
382
  unitConfig: function (config) {
package/duotecno/types.ts CHANGED
@@ -563,7 +563,11 @@ export const Sanitizers = {
563
563
  logicalNodeAddress: info.logicalNodeAddress || 0,
564
564
  logicalAddress: info.logicalAddress || 0,
565
565
  masterAddress: info.masterAddress || '',
566
- masterPort: info.masterPort || 5001
566
+ masterPort: info.masterPort || 5001,
567
+
568
+ name: info.name || ('unit '+info.logicalNodeAddress+":"+info.logicalAddress),
569
+ displayName: info.displayName || ('unit '+info.logicalNodeAddress+":"+info.logicalAddress),
570
+ extendedType: info.extendedType
567
571
  };
568
572
  },
569
573
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-smartsystem",
3
3
  "displayname": "Duotecno Bridge",
4
- "version": "6.2.3",
4
+ "version": "6.2.4",
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",
@@ -20,7 +20,6 @@
20
20
  Settings<button class="right btn waves-effect waves-light" type="submit" name="action" value="reset">Reset to DHCP</button>
21
21
  <button class="right btn waves-effect waves-light" type="submit" name="action" value="install">Install IP Settings</button>
22
22
  <button class="right btn waves-effect waves-light" type="submit" name="action" value="reboot">Reboot PI</button>
23
- <button class="right btn waves-effect waves-light" type="submit" name="action" value="restart">Restart Homebridge</button>
24
23
  </h1>
25
24
 
26
25
  <div class="row">
@@ -41,7 +40,7 @@
41
40
  </div>
42
41
  </div>
43
42
 
44
- <div class="row">
43
+ <!-- div class="row">
45
44
  <div class="input-field col s6">
46
45
  <input placeholder="" id="ip2" name="ip2" type="text" value="<%= config.network.ip2 %>">
47
46
  <label for="ip2">Secondary Fixed IP Address / netmask</label>
@@ -50,7 +49,7 @@
50
49
  <input placeholder="" id="gateway2" name="gateway2" type="text" value="<%= config.network.gateway2 %>">
51
50
  <label for="gateway2">Secondary Gateway</label>
52
51
  </div>
53
- </div>
52
+ </div -->
54
53
 
55
54
  </form>
56
55