homebridge-smartsystem 6.2.2 → 6.2.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 +1 -0
- package/duotecno/types.js +15 -14
- package/duotecno/types.ts +16 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -271,6 +271,7 @@ Homebridge UI version
|
|
|
271
271
|
### v6.2.x - 11-08-2022 - P1 release
|
|
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
|
+
- 3: fixed bug in Sanitizer of UnitConfig preventing from publishing units to homebridge
|
|
274
275
|
|
|
275
276
|
|
|
276
277
|
## Hardware
|
package/duotecno/types.js
CHANGED
|
@@ -380,31 +380,32 @@ exports.Sanitizers = {
|
|
|
380
380
|
if (!config) {
|
|
381
381
|
config = {};
|
|
382
382
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
383
|
+
const cfg = exports.Sanitizers.unitDef(config);
|
|
384
|
+
cfg.active = config.active || 'N';
|
|
385
|
+
cfg.used = config.used || config.active;
|
|
386
386
|
if (typeof config.group === 'string') {
|
|
387
387
|
config.group = parseInt(config.group);
|
|
388
388
|
}
|
|
389
|
-
|
|
390
|
-
return
|
|
389
|
+
cfg.group = config.group || 0;
|
|
390
|
+
return cfg;
|
|
391
391
|
},
|
|
392
392
|
unitScene: function (config) {
|
|
393
393
|
// change + create new clean record for writing to config files
|
|
394
394
|
if (!config) {
|
|
395
395
|
config = {};
|
|
396
396
|
}
|
|
397
|
-
|
|
397
|
+
const cfg = exports.Sanitizers.unitDef(config);
|
|
398
398
|
if (typeof config.value === "undefined")
|
|
399
|
-
|
|
399
|
+
cfg.value = 0;
|
|
400
400
|
if (typeof config.value === "string")
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
401
|
+
cfg.value = parseInt(config.value);
|
|
402
|
+
cfg.name = config.name || "New scene";
|
|
403
|
+
return { logicalNodeAddress: cfg.logicalNodeAddress,
|
|
404
|
+
logicalAddress: cfg.logicalAddress,
|
|
405
|
+
masterAddress: cfg.masterAddress,
|
|
406
|
+
masterPort: cfg.masterPort,
|
|
407
|
+
value: cfg.value,
|
|
408
|
+
name: cfg.name };
|
|
408
409
|
},
|
|
409
410
|
////////////
|
|
410
411
|
// Scenes //
|
package/duotecno/types.ts
CHANGED
|
@@ -570,31 +570,32 @@ export const Sanitizers = {
|
|
|
570
570
|
|
|
571
571
|
unitConfig: function(config?: UnitConfig) { // unitDef + active + group
|
|
572
572
|
if (!config) { config = <UnitConfig>{}; }
|
|
573
|
-
|
|
573
|
+
const cfg = <UnitConfig>Sanitizers.unitDef(config);
|
|
574
574
|
|
|
575
|
-
|
|
576
|
-
|
|
575
|
+
cfg.active = config.active || 'N';
|
|
576
|
+
cfg.used = config.used || config.active;
|
|
577
577
|
|
|
578
578
|
if (typeof config.group === 'string') { config.group = parseInt(config.group); }
|
|
579
|
-
|
|
579
|
+
cfg.group = config.group || 0;
|
|
580
580
|
|
|
581
|
-
return
|
|
581
|
+
return cfg;
|
|
582
582
|
},
|
|
583
583
|
|
|
584
584
|
|
|
585
585
|
unitScene: function(config?: UnitScene) { // unitDef + value
|
|
586
586
|
// change + create new clean record for writing to config files
|
|
587
587
|
if (!config) { config = <UnitScene>{}; }
|
|
588
|
-
|
|
589
|
-
if (typeof config.value === "undefined")
|
|
590
|
-
if (typeof config.value === "string")
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
588
|
+
const cfg = <UnitScene>Sanitizers.unitDef(config);
|
|
589
|
+
if (typeof config.value === "undefined") cfg.value = 0;
|
|
590
|
+
if (typeof config.value === "string") cfg.value = parseInt(config.value);
|
|
591
|
+
cfg.name = config.name || "New scene";
|
|
592
|
+
|
|
593
|
+
return { logicalNodeAddress: cfg.logicalNodeAddress,
|
|
594
|
+
logicalAddress: cfg.logicalAddress,
|
|
595
|
+
masterAddress: cfg.masterAddress,
|
|
596
|
+
masterPort: cfg.masterPort,
|
|
597
|
+
value: cfg.value,
|
|
598
|
+
name: cfg.name };
|
|
598
599
|
},
|
|
599
600
|
|
|
600
601
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-smartsystem",
|
|
3
3
|
"displayname": "Duotecno Bridge",
|
|
4
|
-
"version": "6.2.
|
|
4
|
+
"version": "6.2.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",
|