homebridge-melcloud-control 4.2.0-beta.1 → 4.2.0-beta.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/src/deviceata.js +8 -6
- package/src/deviceatw.js +3 -5
- package/src/deviceerv.js +2 -4
- package/src/melcloudata.js +1 -1
- package/src/melcloudatw.js +1 -1
- package/src/melclouderv.js +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.2.0-beta.
|
|
4
|
+
"version": "4.2.0-beta.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/deviceata.js
CHANGED
|
@@ -26,22 +26,24 @@ class DeviceAta extends EventEmitter {
|
|
|
26
26
|
|
|
27
27
|
//device config
|
|
28
28
|
this.device = device;
|
|
29
|
+
this.deviceId = device.id;
|
|
30
|
+
this.deviceName = device.name;
|
|
31
|
+
this.deviceTypeText = device.typeString;
|
|
29
32
|
this.displayType = device.displayType;
|
|
33
|
+
this.heatDryFanMode = device.heatDryFanMode || 1; //NONE, HEAT, DRY, FAN
|
|
34
|
+
this.coolDryFanMode = device.coolDryFanMode || 1; //NONE, COOL, DRY, FAN
|
|
35
|
+
this.autoDryFanMode = device.autoDryFanMode || 1; //NONE, AUTO, DRY, FAN
|
|
30
36
|
this.temperatureSensor = device.temperatureSensor || false;
|
|
31
37
|
this.temperatureOutdoorSensor = device.temperatureOutdoorSensor || false;
|
|
32
38
|
this.errorSensor = device.errorSensor || false;
|
|
33
39
|
this.frostProtectionSupport = device.frostProtectionSupport || false;
|
|
34
40
|
this.overheatProtectionSupport = device.overheatProtectionSupport || false;
|
|
35
41
|
this.holidayModeSupport = device.holidayModeSupport || false;
|
|
36
|
-
this.heatDryFanMode = device.heatDryFanMode || 1; //NONE, HEAT, DRY, FAN
|
|
37
|
-
this.coolDryFanMode = device.coolDryFanMode || 1; //NONE, COOL, DRY, FAN
|
|
38
|
-
this.autoDryFanMode = device.autoDryFanMode || 1; //NONE, AUTO, DRY, FAN
|
|
39
42
|
this.presets = this.accountType === 'melcloud' ? (device.presets || []).filter(preset => (preset.displayType ?? 0) > 0 && preset.id !== '0') : [];
|
|
40
43
|
this.schedules = this.accountType === 'melcloudhome' ? (device.schedules || []).filter(schedule => (schedule.displayType ?? 0) > 0 && schedule.id !== '0') : [];
|
|
41
44
|
this.buttons = (device.buttonsSensors || []).filter(sensor => (sensor.displayType ?? 0) > 0);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.deviceTypeText = device.typeString;
|
|
45
|
+
|
|
46
|
+
//files
|
|
45
47
|
this.devicesFile = devicesFile;
|
|
46
48
|
this.defaultTempsFile = defaultTempsFile;
|
|
47
49
|
this.displayDeviceInfo = true;
|
package/src/deviceatw.js
CHANGED
|
@@ -1114,9 +1114,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
1114
1114
|
if (this.presets.length > 0) {
|
|
1115
1115
|
if (this.logDebug) this.emit('debug', `Prepare presets services`);
|
|
1116
1116
|
this.presetsServices = [];
|
|
1117
|
-
const presetsIdKey = this.accountType === 'melcloud' ? 'ID' : 'Id';
|
|
1118
1117
|
this.presets.forEach((preset, i) => {
|
|
1119
|
-
const presetData = presetsOnServer.find(p => p
|
|
1118
|
+
const presetData = presetsOnServer.find(p => p.ID === preset.id);
|
|
1120
1119
|
|
|
1121
1120
|
//get preset name
|
|
1122
1121
|
const name = preset.name;
|
|
@@ -1452,7 +1451,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
1452
1451
|
this.deviceData = deviceData;
|
|
1453
1452
|
|
|
1454
1453
|
//keys
|
|
1455
|
-
const presetsIdKey = this.accountType === 'melcloud' ? 'ID' : 'Id';
|
|
1456
1454
|
const tempStepKey = this.accountType === 'melcloud' ? 'TemperatureIncrement' : 'HasHalfDegreeIncrements';
|
|
1457
1455
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
1458
1456
|
|
|
@@ -1957,7 +1955,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1957
1955
|
//presets
|
|
1958
1956
|
if (this.presets.length > 0) {
|
|
1959
1957
|
this.presets.forEach((preset, i) => {
|
|
1960
|
-
const presetData = presetsOnServer.find(p => p
|
|
1958
|
+
const presetData = presetsOnServer.find(p => p.ID === preset.id);
|
|
1961
1959
|
|
|
1962
1960
|
preset.state = presetData ? (presetData.Power === power
|
|
1963
1961
|
&& presetData.EcoHotWater === ecoHotWater
|
|
@@ -1984,7 +1982,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1984
1982
|
if (i === 0) this.schedulesControlService?.updateCharacteristic(Characteristic.On, scheduleEnabled);
|
|
1985
1983
|
|
|
1986
1984
|
//sensors
|
|
1987
|
-
const scheduleData = schedulesOnServer.find(s => s
|
|
1985
|
+
const scheduleData = schedulesOnServer.find(s => s.Id === schedule.id);
|
|
1988
1986
|
schedule.state = scheduleEnabled ? scheduleData.Enabled ?? false : false;
|
|
1989
1987
|
|
|
1990
1988
|
const characteristicType = schedule.characteristicType;
|
package/src/deviceerv.js
CHANGED
|
@@ -996,8 +996,6 @@ class DeviceErv extends EventEmitter {
|
|
|
996
996
|
this.deviceData = deviceData;
|
|
997
997
|
|
|
998
998
|
//keys
|
|
999
|
-
const presetsIdKey = this.accountType === 'melcloud' ? 'ID' : 'Id';
|
|
1000
|
-
const fanKey = this.accountType === 'melcloud' ? 'FanSpeed' : 'SetFanSpeed';
|
|
1001
999
|
const tempStepKey = this.accountType === 'melcloud' ? 'TemperatureIncrement' : 'HasHalfDegreeIncrements';
|
|
1002
1000
|
const errorKey = this.accountType === 'melcloud' ? 'HasError' : 'IsInError';
|
|
1003
1001
|
|
|
@@ -1250,7 +1248,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1250
1248
|
//presets
|
|
1251
1249
|
if (this.presets.length > 0) {
|
|
1252
1250
|
this.presets.forEach((preset, i) => {
|
|
1253
|
-
const presetData = presetsOnServer.find(p => p
|
|
1251
|
+
const presetData = presetsOnServer.find(p => p.ID === preset.id);
|
|
1254
1252
|
|
|
1255
1253
|
preset.state = presetData ? (presetData.Power === power
|
|
1256
1254
|
&& presetData.SetTemperature === setTemperature
|
|
@@ -1270,7 +1268,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1270
1268
|
if (i === 0) this.schedulesControlService?.updateCharacteristic(Characteristic.On, scheduleEnabled);
|
|
1271
1269
|
|
|
1272
1270
|
//sensors
|
|
1273
|
-
const scheduleData = schedulesOnServer.find(s => s
|
|
1271
|
+
const scheduleData = schedulesOnServer.find(s => s.Id === schedule.id);
|
|
1274
1272
|
schedule.state = scheduleEnabled ? scheduleData.Enabled ?? false : false;
|
|
1275
1273
|
|
|
1276
1274
|
const characteristicType = schedule.characteristicType;
|
package/src/melcloudata.js
CHANGED
package/src/melcloudatw.js
CHANGED