homebridge-melcloud-control 3.0.7-beta.12 → 3.0.7-beta.14
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/config.schema.json +0 -7
- package/homebridge-ui/public/index.html +27 -13
- package/homebridge-ui/server.js +2 -1
- package/package.json +1 -1
package/config.schema.json
CHANGED
|
@@ -1466,13 +1466,6 @@
|
|
|
1466
1466
|
"key": "accounts[].ataDevices[].type",
|
|
1467
1467
|
"readonly": true
|
|
1468
1468
|
},
|
|
1469
|
-
{
|
|
1470
|
-
"key": "accounts[].ataDevices[].idType",
|
|
1471
|
-
"type": "text",
|
|
1472
|
-
"title": "ID and Type",
|
|
1473
|
-
"readonly": true,
|
|
1474
|
-
"template": "{{ accounts[].ataDevices[].id }} - {{ accounts[].ataDevices[].type }}"
|
|
1475
|
-
},
|
|
1476
1469
|
{
|
|
1477
1470
|
"key": "accounts[].ataDevices[]",
|
|
1478
1471
|
"type": "section",
|
|
@@ -147,15 +147,23 @@
|
|
|
147
147
|
const info = response.info ?? '';
|
|
148
148
|
const status = response.status;
|
|
149
149
|
const devices = response.data ?? [];
|
|
150
|
-
const newDevices =
|
|
150
|
+
const newDevices = {
|
|
151
|
+
ata: [],
|
|
152
|
+
atw: [],
|
|
153
|
+
erv: []
|
|
154
|
+
};
|
|
151
155
|
|
|
152
156
|
switch (status) {
|
|
153
157
|
case 0:
|
|
154
158
|
//get device info fom devices
|
|
155
|
-
devices.forEach((
|
|
156
|
-
const deviceType =
|
|
157
|
-
const deviceId =
|
|
158
|
-
const deviceName =
|
|
159
|
+
devices.forEach((device, index) => {
|
|
160
|
+
const deviceType = device.Type;
|
|
161
|
+
const deviceId = device.DeviceID;
|
|
162
|
+
const deviceName = device.DeviceName;
|
|
163
|
+
const deviceTypeText = ["Air Conditioner", "Heat Pump", "Unknown", "Energy Recovery Ventilation"][device.Type];
|
|
164
|
+
let textAta = '';
|
|
165
|
+
let textAtw = '';
|
|
166
|
+
let textErv = '';
|
|
159
167
|
|
|
160
168
|
//config account keys
|
|
161
169
|
const accountKeys = Object.keys(pluginConfig[0].accounts[this.deviceIndex]);
|
|
@@ -165,7 +173,7 @@
|
|
|
165
173
|
const deviceAta = {
|
|
166
174
|
name: deviceName,
|
|
167
175
|
id: deviceId,
|
|
168
|
-
type:
|
|
176
|
+
type: deviceTypeText,
|
|
169
177
|
displayMode: 0,
|
|
170
178
|
heatDryFanMode: 0,
|
|
171
179
|
coolDryFanMode: 0,
|
|
@@ -180,7 +188,9 @@
|
|
|
180
188
|
const ataDevices = ataDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].ataDevices : pluginConfig[0].accounts[this.deviceIndex].ataDevices = [];
|
|
181
189
|
const ataDeviceIdExist = ataDevices.some(device => device.id === deviceId);
|
|
182
190
|
const pushTypeAta = ataDeviceIdExist ? false : ataDevices.push(deviceAta);
|
|
183
|
-
const pushNewDevice = ataDeviceIdExist ? false : newDevices.push(
|
|
191
|
+
const pushNewDevice = ataDeviceIdExist ? false : newDevices.ata.push(device);
|
|
192
|
+
const devicesCount = newDevices.ata.length;
|
|
193
|
+
textAta = `ATA: ${devicesCount}`
|
|
184
194
|
};
|
|
185
195
|
|
|
186
196
|
//devices atw
|
|
@@ -188,7 +198,7 @@
|
|
|
188
198
|
const deviceAtw = {
|
|
189
199
|
name: deviceName,
|
|
190
200
|
id: deviceId,
|
|
191
|
-
type:
|
|
201
|
+
type: deviceTypeText,
|
|
192
202
|
displayMode: 0,
|
|
193
203
|
temperatureSensor: false,
|
|
194
204
|
temperatureSensorFlow: false,
|
|
@@ -208,7 +218,9 @@
|
|
|
208
218
|
const atwDevices = atwDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].atwDevices : pluginConfig[0].accounts[this.deviceIndex].atwDevices = [];
|
|
209
219
|
const atwDeviceIdExist = atwDevices.some(device => device.id === deviceId);
|
|
210
220
|
const pushTypeatw = atwDeviceIdExist ? false : atwDevices.push(deviceAtw);
|
|
211
|
-
const pushNewDevice = atwDeviceIdExist ? false : newDevices.push(
|
|
221
|
+
const pushNewDevice = atwDeviceIdExist ? false : newDevices.atw.push(device);
|
|
222
|
+
const devicesCount = newDevices.ata.length;
|
|
223
|
+
textAtw = `ATW: ${devicesCount}`
|
|
212
224
|
};
|
|
213
225
|
|
|
214
226
|
//devices erv
|
|
@@ -216,7 +228,7 @@
|
|
|
216
228
|
const deviceErv = {
|
|
217
229
|
name: deviceName,
|
|
218
230
|
id: deviceId,
|
|
219
|
-
type:
|
|
231
|
+
type: deviceTypeText,
|
|
220
232
|
displayMode: 0,
|
|
221
233
|
temperatureSensor: false,
|
|
222
234
|
temperatureSensorOutdoor: false,
|
|
@@ -230,12 +242,14 @@
|
|
|
230
242
|
const ervDevices = ervDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].ervDevices : pluginConfig[0].accounts[this.deviceIndex].ervDevices = [];
|
|
231
243
|
const ervDeviceIdExist = ervDevices.some(device => device.id === deviceId);
|
|
232
244
|
const pushTypeerv = ervDeviceIdExist ? false : ervDevices.push(deviceErv);
|
|
233
|
-
const pushNewDevice = ervDeviceIdExist ? false : newDevices.push(
|
|
245
|
+
const pushNewDevice = ervDeviceIdExist ? false : newDevices.erv.push(device);
|
|
246
|
+
const devicesCount = newDevices.ata.length;
|
|
247
|
+
textErv = `ERV: ${devicesCount}`
|
|
234
248
|
};
|
|
235
249
|
});
|
|
236
250
|
|
|
237
|
-
const
|
|
238
|
-
document.getElementById('info').innerHTML = `
|
|
251
|
+
const newDevicesCount = newDevices.ata.length + newDevices.atw.length + newDevices.erv.length;
|
|
252
|
+
document.getElementById('info').innerHTML = `Found devices: ${textAta}, ${textAtw}, ${textErv}. ${newDevicesCount === 0 ? '' : 'Now You can start to configure it.'}`;
|
|
239
253
|
document.getElementById('info').style.color = 'green';
|
|
240
254
|
|
|
241
255
|
await homebridge.updatePluginConfig(pluginConfig);
|
package/homebridge-ui/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "3.0.7-beta.
|
|
4
|
+
"version": "3.0.7-beta.14",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|