homebridge-melcloud-control 2.5.0-beta.50 → 2.5.0-beta.52
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 +39 -9
- package/homebridge-ui/public/index.html +16 -9
- package/package.json +1 -1
package/config.schema.json
CHANGED
|
@@ -1592,10 +1592,20 @@
|
|
|
1592
1592
|
"key": "accounts[].ataDevices",
|
|
1593
1593
|
"type": "tabarray",
|
|
1594
1594
|
"title": "{{ value.name }}",
|
|
1595
|
+
"addable": false,
|
|
1595
1596
|
"items": [
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1597
|
+
{
|
|
1598
|
+
"key": "accounts[].ataDevices[].name",
|
|
1599
|
+
"readonly": true
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
"key": "accounts[].ataDevices[].id",
|
|
1603
|
+
"readonly": true
|
|
1604
|
+
},
|
|
1605
|
+
{
|
|
1606
|
+
"key": "accounts[].ataDevices[].type",
|
|
1607
|
+
"readonly": true
|
|
1608
|
+
},
|
|
1599
1609
|
"accounts[].ataDevices[].displayMode"
|
|
1600
1610
|
]
|
|
1601
1611
|
},
|
|
@@ -1672,10 +1682,20 @@
|
|
|
1672
1682
|
"key": "accounts[].atwDevices",
|
|
1673
1683
|
"type": "tabarray",
|
|
1674
1684
|
"title": "{{ value.name }}",
|
|
1685
|
+
"addable": false,
|
|
1675
1686
|
"items": [
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1687
|
+
{
|
|
1688
|
+
"key": "accounts[].atwDevices[].name",
|
|
1689
|
+
"readonly": true
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
"key": "accounts[].atwDevices[].id",
|
|
1693
|
+
"readonly": true
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
"key": "accounts[].atwDevices[].type",
|
|
1697
|
+
"readonly": true
|
|
1698
|
+
},
|
|
1679
1699
|
"accounts[].atwDevices[].displayMode"
|
|
1680
1700
|
]
|
|
1681
1701
|
},
|
|
@@ -1747,10 +1767,20 @@
|
|
|
1747
1767
|
"key": "accounts[].ervDevices",
|
|
1748
1768
|
"type": "tabarray",
|
|
1749
1769
|
"title": "{{ value.name }}",
|
|
1770
|
+
"addable": false,
|
|
1750
1771
|
"items": [
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1772
|
+
{
|
|
1773
|
+
"key": "accounts[].ervDevices[].name",
|
|
1774
|
+
"readonly": true
|
|
1775
|
+
},
|
|
1776
|
+
{
|
|
1777
|
+
"key": "accounts[].ervDevices[].id",
|
|
1778
|
+
"readonly": true
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
"key": "accounts[].ervDevices[].type",
|
|
1782
|
+
"readonly": true
|
|
1783
|
+
},
|
|
1754
1784
|
"accounts[].ervDevices[].displayMode"
|
|
1755
1785
|
]
|
|
1756
1786
|
},
|
|
@@ -156,25 +156,32 @@
|
|
|
156
156
|
const deviceType = deviceInfo.Type;
|
|
157
157
|
const deviceId = deviceInfo.DeviceID;
|
|
158
158
|
const deviceName = deviceInfo.DeviceName;
|
|
159
|
+
const device = { name: deviceName, id: deviceId, type: deviceType, displayMode: 0 };
|
|
159
160
|
|
|
161
|
+
//config account keys
|
|
160
162
|
const accountKeys = Object.keys(pluginConfig[0].accounts[this.deviceIndex]);
|
|
161
|
-
const ataDevices = accountKeys.includes('ataDevices') ? pluginConfig[0].accounts[this.deviceIndex].ataDevices : pluginConfig[0].accounts[this.deviceIndex].ataDevices = [];
|
|
162
|
-
const atwDevices = accountKeys.includes('atwDevices') ? pluginConfig[0].accounts[this.deviceIndex].atwDevices : pluginConfig[0].accounts[this.deviceIndex].atwDevices = [];
|
|
163
|
-
const ervDevices = accountKeys.includes('ervDevices') ? pluginConfig[0].accounts[this.deviceIndex].ervDevices : pluginConfig[0].accounts[this.deviceIndex].ervDevices = [];
|
|
164
163
|
|
|
164
|
+
//devices ata
|
|
165
|
+
const ataDevices = accountKeys.includes('ataDevices') ? pluginConfig[0].accounts[this.deviceIndex].ataDevices : pluginConfig[0].accounts[this.deviceIndex].ataDevices = [];
|
|
165
166
|
const ataDeviceIdExist = ataDevices.some(device => device.id === deviceId)
|
|
166
|
-
const atwDeviceIdExist = atwDevices.some(device => device.id === deviceId)
|
|
167
|
-
const ervDeviceIdExist = ervDevices.some(device => device.id === deviceId)
|
|
168
|
-
const pushNewDevice = ataDeviceIdExist || atwDeviceIdExist || ervDeviceIdExist ? false : newDevices.push(deviceId);
|
|
169
|
-
|
|
170
|
-
const device = { name: deviceName, id: deviceId, type: deviceType, displayMode: 0 };
|
|
171
167
|
const pushTypeAta = deviceType === 0 && !ataDeviceIdExist ? ataDevices.push(device) : false;
|
|
168
|
+
|
|
169
|
+
//devices atw
|
|
170
|
+
const atwDevices = accountKeys.includes('atwDevices') ? pluginConfig[0].accounts[this.deviceIndex].atwDevices : pluginConfig[0].accounts[this.deviceIndex].atwDevices = [];
|
|
171
|
+
const atwDeviceIdExist = atwDevices.some(device => device.id === deviceId)
|
|
172
172
|
const pushTypeAtw = deviceType === 1 && !atwDeviceIdExist ? atwDevices.push(device) : false;
|
|
173
|
+
|
|
174
|
+
//devices erv
|
|
175
|
+
const ervDevices = accountKeys.includes('ervDevices') ? pluginConfig[0].accounts[this.deviceIndex].ervDevices : pluginConfig[0].accounts[this.deviceIndex].ervDevices = [];
|
|
176
|
+
const ervDeviceIdExist = ervDevices.some(device => device.id === deviceId)
|
|
173
177
|
const pushTypeErv = deviceType === 3 && !ervDeviceIdExist ? ervDevices.push(device) : false;
|
|
178
|
+
|
|
179
|
+
//push new devices to array
|
|
180
|
+
const pushNewDevice = ataDeviceIdExist || atwDeviceIdExist || ervDeviceIdExist ? false : newDevices.push(deviceId);
|
|
174
181
|
});
|
|
175
182
|
|
|
176
183
|
const devicesCount = newDevices.length;
|
|
177
|
-
document.getElementById('info').innerHTML = `
|
|
184
|
+
document.getElementById('info').innerHTML = `Check devices complete, found ${devicesCount} ${devicesCount !== 1 ? 'new devices' : 'new device'}. ${devicesCount === 0 ? '' : 'Now You can start to configure it'}.`;
|
|
178
185
|
document.getElementById('info').style.color = 'green';
|
|
179
186
|
|
|
180
187
|
await homebridge.updatePluginConfig(pluginConfig);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "2.5.0-beta.
|
|
4
|
+
"version": "2.5.0-beta.52",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|