homebridge-melcloud-control 3.9.2-beta.0 → 3.9.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/index.js +5 -5
- package/package.json +1 -1
- package/src/mqtt.js +2 -2
- package/src/restful.js +2 -6
package/index.js
CHANGED
|
@@ -56,11 +56,11 @@ class MelCloudPlatform {
|
|
|
56
56
|
const enableDebugMode = account.enableDebugMode || false;
|
|
57
57
|
const logLevel = {
|
|
58
58
|
debug: enableDebugMode,
|
|
59
|
-
info: !
|
|
60
|
-
success: !
|
|
61
|
-
warn: !
|
|
62
|
-
error: !
|
|
63
|
-
devInfo: !
|
|
59
|
+
info: !account.disableLogInfo,
|
|
60
|
+
success: !account.disableLogSuccess,
|
|
61
|
+
warn: !account.disableLogWarn,
|
|
62
|
+
error: !account.disableLogError,
|
|
63
|
+
devInfo: !account.disableLogDeviceInfo,
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
if (logLevel.debug) log.info(`${accountName}, debug: Did finish launching.`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "3.9.2
|
|
4
|
+
"version": "3.9.2",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
package/src/mqtt.js
CHANGED
|
@@ -27,7 +27,7 @@ class Mqtt extends EventEmitter {
|
|
|
27
27
|
this.mqttClient.on('message', (topic, message) => {
|
|
28
28
|
try {
|
|
29
29
|
const obj = JSON.parse(message.toString());
|
|
30
|
-
|
|
30
|
+
if (config.debug) this.emit('debug', `MQTT Received topic: ${topic}, message: ${JSON.stringify(obj, null, 2)}`);
|
|
31
31
|
const key = Object.keys(obj)[0];
|
|
32
32
|
const value = Object.values(obj)[0];
|
|
33
33
|
this.emit('set', key, value);
|
|
@@ -43,7 +43,7 @@ class Mqtt extends EventEmitter {
|
|
|
43
43
|
const fullTopic = `${config.prefix}/${topic}`;
|
|
44
44
|
const publishMessage = JSON.stringify(message, null, 2);
|
|
45
45
|
await this.mqttClient.publish(fullTopic, publishMessage);
|
|
46
|
-
|
|
46
|
+
if (config.debug) this.emit('debug', `MQTT Publish topic: ${fullTopic}, message: ${publishMessage}`);
|
|
47
47
|
} catch (error) {
|
|
48
48
|
this.emit('warn', `MQTT Publish error: ${error}`);
|
|
49
49
|
};
|
package/src/restful.js
CHANGED
|
@@ -53,9 +53,7 @@ class RestFul extends EventEmitter {
|
|
|
53
53
|
this.emit('set', key, value);
|
|
54
54
|
this.update(key, value);
|
|
55
55
|
|
|
56
|
-
if (this.restFulDebug) {
|
|
57
|
-
this.emit('debug', `RESTFul post data: ${JSON.stringify(obj, null, 2)}`);
|
|
58
|
-
}
|
|
56
|
+
if (this.restFulDebug) this.emit('debug', `RESTFul post data: ${JSON.stringify(obj, null, 2)}`);
|
|
59
57
|
|
|
60
58
|
res.json({ success: true, received: obj });
|
|
61
59
|
} catch (error) {
|
|
@@ -81,9 +79,7 @@ class RestFul extends EventEmitter {
|
|
|
81
79
|
return;
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
if (this.restFulDebug) {
|
|
85
|
-
this.emit('debug', `RESTFul update path: ${path}, data: ${JSON.stringify(data)}`);
|
|
86
|
-
}
|
|
82
|
+
if (this.restFulDebug) this.emit('debug', `RESTFul update path: ${path}, data: ${JSON.stringify(data)}`);
|
|
87
83
|
}
|
|
88
84
|
}
|
|
89
85
|
|