homebridge-melcloud-control 4.3.7 → 4.3.8-beta.1
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 +10 -2
- package/package.json +1 -1
- package/src/deviceata.js +4 -3
- package/src/deviceatw.js +5 -4
- package/src/deviceerv.js +5 -4
- package/src/functions.js +1 -0
- package/src/melcloudata.js +3 -2
- package/src/melcloudatw.js +3 -3
- package/src/melclouderv.js +3 -2
- package/src/mqtt.js +3 -2
package/index.js
CHANGED
|
@@ -128,14 +128,22 @@ class MelCloudPlatform {
|
|
|
128
128
|
const atwDevices = (account.atwDevices || []).filter(device => device.id != null && String(device.id) !== '0');
|
|
129
129
|
const ervDevices = (account.ervDevices || []).filter(device => device.id != null && String(device.id) !== '0');
|
|
130
130
|
const devices = [...ataDevices, ...atwDevices, ...ervDevices];
|
|
131
|
-
if (logLevel.debug) log.info(
|
|
131
|
+
if (logLevel.debug) log.info(`${accountName}, found configured devices ATA: ${ataDevices.length}, ATW: ${atwDevices.length}, ERV: ${ervDevices.length}.`);
|
|
132
132
|
|
|
133
133
|
for (const [index, device] of devices.entries()) {
|
|
134
134
|
//chack device from config exist on melcloud
|
|
135
135
|
const displayType = device.displayType > 0;
|
|
136
|
+
if (!displayType) {
|
|
137
|
+
if (logLevel.warn) log.warn(`${accountName}, ${deviceTypeString}, ${deviceName} disabled in config, will not be published in Home app.`);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
|
|
136
141
|
device.id = String(device.id);
|
|
137
142
|
const deviceExistInMelCloud = melcloudDevicesList.Devices.some(dev => dev.DeviceID === device.id);
|
|
138
|
-
if (!deviceExistInMelCloud
|
|
143
|
+
if (!deviceExistInMelCloud) {
|
|
144
|
+
if (logLevel.warn) log.warn(`${accountName}, ${deviceTypeString}, ${deviceName} not exist in MELCLoud, please login to MELCLoud from plugin UI to correct this issue.`);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
139
147
|
|
|
140
148
|
const deviceName = device.name;
|
|
141
149
|
const deviceType = device.type;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.3.
|
|
4
|
+
"version": "4.3.8-beta.1",
|
|
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/deviceata.js
CHANGED
|
@@ -106,7 +106,7 @@ class DeviceAta extends EventEmitter {
|
|
|
106
106
|
this.displayDeviceInfo = true;
|
|
107
107
|
this.deviceData = {};
|
|
108
108
|
this.accessory = {};
|
|
109
|
-
}
|
|
109
|
+
}
|
|
110
110
|
|
|
111
111
|
async externalIntegrations() {
|
|
112
112
|
//RESTFul server
|
|
@@ -1888,6 +1888,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1888
1888
|
} catch (error) {
|
|
1889
1889
|
throw new Error(`Start error: ${error}`);
|
|
1890
1890
|
};
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1893
1894
|
export default DeviceAta;
|
package/src/deviceatw.js
CHANGED
|
@@ -110,7 +110,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
110
110
|
this.displayDeviceInfo = true;
|
|
111
111
|
this.deviceData = {};
|
|
112
112
|
this.accessory = {};
|
|
113
|
-
}
|
|
113
|
+
}
|
|
114
114
|
|
|
115
115
|
async externalIntegrations() {
|
|
116
116
|
//RESTFul server
|
|
@@ -1561,7 +1561,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1561
1561
|
} catch (error) {
|
|
1562
1562
|
throw new Error(`Prepare accessory error: ${error}`);
|
|
1563
1563
|
};
|
|
1564
|
-
}
|
|
1564
|
+
}
|
|
1565
1565
|
|
|
1566
1566
|
//start
|
|
1567
1567
|
async start() {
|
|
@@ -2315,6 +2315,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
2315
2315
|
} catch (error) {
|
|
2316
2316
|
throw new Error(`Start error: ${error}`);
|
|
2317
2317
|
};
|
|
2318
|
-
}
|
|
2319
|
-
}
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2320
2321
|
export default DeviceAtw;
|
package/src/deviceerv.js
CHANGED
|
@@ -102,7 +102,7 @@ class DeviceErv extends EventEmitter {
|
|
|
102
102
|
this.displayDeviceInfo = true;
|
|
103
103
|
this.deviceData = {};
|
|
104
104
|
this.accessory = {};
|
|
105
|
-
}
|
|
105
|
+
}
|
|
106
106
|
|
|
107
107
|
async externalIntegrations() {
|
|
108
108
|
//RESTFul server
|
|
@@ -1115,7 +1115,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1115
1115
|
} catch (error) {
|
|
1116
1116
|
throw new Error(`Prepare accessory error: ${error}`);
|
|
1117
1117
|
};
|
|
1118
|
-
}
|
|
1118
|
+
}
|
|
1119
1119
|
|
|
1120
1120
|
//start
|
|
1121
1121
|
async start() {
|
|
@@ -1589,6 +1589,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1589
1589
|
} catch (error) {
|
|
1590
1590
|
throw new Error(`Start error: ${error}`);
|
|
1591
1591
|
};
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1594
1595
|
export default DeviceErv;
|
package/src/functions.js
CHANGED
package/src/melcloudata.js
CHANGED
|
@@ -166,7 +166,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
166
166
|
} catch (error) {
|
|
167
167
|
throw new Error(`Update state error: ${error.message}`);
|
|
168
168
|
};
|
|
169
|
-
}
|
|
169
|
+
}
|
|
170
170
|
|
|
171
171
|
async checkState(devicesData) {
|
|
172
172
|
try {
|
|
@@ -332,5 +332,6 @@ class MelCloudAta extends EventEmitter {
|
|
|
332
332
|
throw new Error(`Send data error: ${error.message}`);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
}
|
|
335
|
+
}
|
|
336
|
+
|
|
336
337
|
export default MelCloudAta;
|
package/src/melcloudatw.js
CHANGED
|
@@ -88,7 +88,6 @@ class MelCloudAtw extends EventEmitter {
|
|
|
88
88
|
if (this.logError) this.emit('error', `Web socket process message error: ${error}`);
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
|
|
92
91
|
}
|
|
93
92
|
|
|
94
93
|
async updateState(deviceData) {
|
|
@@ -156,7 +155,7 @@ class MelCloudAtw extends EventEmitter {
|
|
|
156
155
|
} catch (error) {
|
|
157
156
|
throw new Error(`Check state error: ${error.message}`);
|
|
158
157
|
};
|
|
159
|
-
}
|
|
158
|
+
}
|
|
160
159
|
|
|
161
160
|
async checkState(devicesData) {
|
|
162
161
|
try {
|
|
@@ -307,5 +306,6 @@ class MelCloudAtw extends EventEmitter {
|
|
|
307
306
|
throw new Error(`Send data error: ${error.message}`);
|
|
308
307
|
}
|
|
309
308
|
}
|
|
310
|
-
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
311
|
export default MelCloudAtw;
|
package/src/melclouderv.js
CHANGED
|
@@ -159,7 +159,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
159
159
|
} catch (error) {
|
|
160
160
|
throw new Error(`Check state error: ${error.message}`);
|
|
161
161
|
};
|
|
162
|
-
}
|
|
162
|
+
}
|
|
163
163
|
|
|
164
164
|
async checkState(devicesData) {
|
|
165
165
|
try {
|
|
@@ -315,5 +315,6 @@ class MelCloudErv extends EventEmitter {
|
|
|
315
315
|
throw new Error(`Send data error: ${error.message}`);
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
}
|
|
318
|
+
}
|
|
319
|
+
|
|
319
320
|
export default MelCloudErv;
|