homebridge-smartsystem 6.0.1 → 6.0.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/package.json +1 -1
- package/server/platform.js +6 -6
- package/server/platform.ts +6 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-smartsystem",
|
|
3
3
|
"displayname": "Duotecno Bridge",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.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",
|
package/server/platform.js
CHANGED
|
@@ -36,17 +36,17 @@ class Platform extends base_1.Base {
|
|
|
36
36
|
this.config.debug = (config && ("debug" in config)) ? config.debug : false;
|
|
37
37
|
this.log("running in directory: " + process.cwd());
|
|
38
38
|
this.log("with config:" + JSON.stringify(config, null, 2));
|
|
39
|
-
// this.log("homebridge object:",
|
|
39
|
+
// this.log("homebridge object:", api);
|
|
40
40
|
this.homebridgeAPI = api;
|
|
41
41
|
if (this.config.system) {
|
|
42
42
|
try {
|
|
43
|
-
this.system = new system_1.System(
|
|
43
|
+
this.system = new system_1.System(log.info, false);
|
|
44
44
|
this.system.openMasters(true);
|
|
45
45
|
this.system.emitter.on('ready', this.systemReady.bind(this));
|
|
46
46
|
this.system.emitter.on('update', this.updateState.bind(this));
|
|
47
47
|
}
|
|
48
48
|
catch (err) {
|
|
49
|
-
log
|
|
49
|
+
this.log(err);
|
|
50
50
|
if (!this.system) {
|
|
51
51
|
this.log("platform - Can't run without a System.");
|
|
52
52
|
return;
|
|
@@ -60,7 +60,7 @@ class Platform extends base_1.Base {
|
|
|
60
60
|
// startup a Smappee MQTT subscriber, if one is configured
|
|
61
61
|
if (this.config.smappee) {
|
|
62
62
|
try {
|
|
63
|
-
this.smappee = new smappee_1.Smappee(this.system,
|
|
63
|
+
this.smappee = new smappee_1.Smappee(this.system, log.info);
|
|
64
64
|
}
|
|
65
65
|
catch (err) {
|
|
66
66
|
this.log(err);
|
|
@@ -75,7 +75,7 @@ class Platform extends base_1.Base {
|
|
|
75
75
|
// startup a smartApp if configured -> only on Raspberry's
|
|
76
76
|
if (this.config.smartapp) {
|
|
77
77
|
try {
|
|
78
|
-
this.smartapp = new smartapp_1.SmartApp(this.system, this.smappee, this,
|
|
78
|
+
this.smartapp = new smartapp_1.SmartApp(this.system, this.smappee, this, log.info, false);
|
|
79
79
|
this.smartapp.serve();
|
|
80
80
|
}
|
|
81
81
|
catch (err) {
|
|
@@ -92,7 +92,7 @@ class Platform extends base_1.Base {
|
|
|
92
92
|
if (this.config.socapp) {
|
|
93
93
|
try {
|
|
94
94
|
// reuse the config file from the smartapp
|
|
95
|
-
this.smartsoc = new socapp_1.SocApp(this.system, 'smartapp',
|
|
95
|
+
this.smartsoc = new socapp_1.SocApp(this.system, 'smartapp', log.info);
|
|
96
96
|
this.smartsoc.serve();
|
|
97
97
|
}
|
|
98
98
|
catch (err) {
|
package/server/platform.ts
CHANGED
|
@@ -28,7 +28,6 @@ export class Platform extends Base {
|
|
|
28
28
|
accessoryList: Array<Accessory> = [];
|
|
29
29
|
ready = false;
|
|
30
30
|
startWaiting = 0;
|
|
31
|
-
log: LogFunction;
|
|
32
31
|
|
|
33
32
|
constructor(log: Logger, config: PlatformConfig, api: API) {
|
|
34
33
|
// set debug to true for new config files
|
|
@@ -39,20 +38,20 @@ export class Platform extends Base {
|
|
|
39
38
|
|
|
40
39
|
this.log("running in directory: " + process.cwd());
|
|
41
40
|
this.log("with config:" + JSON.stringify(config, null, 2));
|
|
42
|
-
// this.log("homebridge object:",
|
|
41
|
+
// this.log("homebridge object:", api);
|
|
43
42
|
|
|
44
43
|
this.homebridgeAPI = api;
|
|
45
44
|
|
|
46
45
|
if (this.config.system) {
|
|
47
46
|
try {
|
|
48
|
-
this.system = new System(
|
|
47
|
+
this.system = new System(log.info, false);
|
|
49
48
|
this.system.openMasters(true);
|
|
50
49
|
|
|
51
50
|
this.system.emitter.on('ready', this.systemReady.bind(this));
|
|
52
51
|
this.system.emitter.on('update', this.updateState.bind(this));
|
|
53
52
|
|
|
54
53
|
} catch(err) {
|
|
55
|
-
log
|
|
54
|
+
this.log(err);
|
|
56
55
|
if (!this.system) {
|
|
57
56
|
this.log("platform - Can't run without a System.");
|
|
58
57
|
return;
|
|
@@ -66,7 +65,7 @@ export class Platform extends Base {
|
|
|
66
65
|
// startup a Smappee MQTT subscriber, if one is configured
|
|
67
66
|
if (this.config.smappee) {
|
|
68
67
|
try {
|
|
69
|
-
this.smappee = new Smappee(this.system,
|
|
68
|
+
this.smappee = new Smappee(this.system, log.info);
|
|
70
69
|
|
|
71
70
|
} catch(err) {
|
|
72
71
|
this.log(err);
|
|
@@ -81,7 +80,7 @@ export class Platform extends Base {
|
|
|
81
80
|
// startup a smartApp if configured -> only on Raspberry's
|
|
82
81
|
if (this.config.smartapp) {
|
|
83
82
|
try {
|
|
84
|
-
this.smartapp = new SmartApp(this.system, this.smappee, this,
|
|
83
|
+
this.smartapp = new SmartApp(this.system, this.smappee, this, log.info, false);
|
|
85
84
|
this.smartapp.serve();
|
|
86
85
|
|
|
87
86
|
} catch(err) {
|
|
@@ -98,7 +97,7 @@ export class Platform extends Base {
|
|
|
98
97
|
if (this.config.socapp) {
|
|
99
98
|
try {
|
|
100
99
|
// reuse the config file from the smartapp
|
|
101
|
-
this.smartsoc = new SocApp(this.system, 'smartapp',
|
|
100
|
+
this.smartsoc = new SocApp(this.system, 'smartapp', log.info);
|
|
102
101
|
this.smartsoc.serve();
|
|
103
102
|
|
|
104
103
|
} catch(err) {
|