homebridge-melcloud-control 4.3.3-beta.14 → 4.3.3-beta.15
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 +2 -2
- package/src/functions.js +8 -0
- package/src/melcloudata.js +4 -14
- package/src/melcloudhome.js +0 -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.3.3-beta.
|
|
4
|
+
"version": "4.3.3-beta.15",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"node": "^20 || ^22 || ^24 || ^25"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@homebridge/plugin-ui-utils": "^2.1.
|
|
38
|
+
"@homebridge/plugin-ui-utils": "^2.1.2",
|
|
39
39
|
"async-mqtt": "^2.6.3",
|
|
40
40
|
"axios": "^1.13.2",
|
|
41
41
|
"express": "^5.1.0",
|
package/src/functions.js
CHANGED
|
@@ -167,5 +167,13 @@ class Functions extends EventEmitter {
|
|
|
167
167
|
else if (!isNaN(v) && v !== "") parsedValue = Number(v);
|
|
168
168
|
return parsedValue;
|
|
169
169
|
}
|
|
170
|
+
|
|
171
|
+
parseArrayNameValue(data) {
|
|
172
|
+
Object.fromEntries(
|
|
173
|
+
data.map(({ name, value }) => {
|
|
174
|
+
let parsedValue = this.convertValue(value);
|
|
175
|
+
return [name, parsedValue];
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
170
178
|
}
|
|
171
179
|
export default Functions
|
package/src/melcloudata.js
CHANGED
|
@@ -76,8 +76,8 @@ class MelCloudAta extends EventEmitter {
|
|
|
76
76
|
deviceData.Device.OperationMode = AirConditioner.OperationModeMapStringToEnum[deviceData.Device.OperationMode] ?? deviceData.Device.OperationMode;
|
|
77
77
|
deviceData.Device.ActualFanSpeed = AirConditioner.FanSpeedMapStringToEnum[deviceData.Device.ActualFanSpeed] ?? deviceData.Device.ActualFanSpeed;
|
|
78
78
|
deviceData.Device.SetFanSpeed = AirConditioner.FanSpeedMapStringToEnum[deviceData.Device.SetFanSpeed] ?? deviceData.Device.SetFanSpeed;
|
|
79
|
-
deviceData.Device.VaneVerticalDirection = AirConditioner.VaneVerticalDirectionMapStringToEnum[deviceData.Device.VaneVerticalDirection] ?? deviceData.Device.VaneVerticalDirection;
|
|
80
79
|
deviceData.Device.VaneHorizontalDirection = AirConditioner.VaneHorizontalDirectionMapStringToEnum[deviceData.Device.VaneHorizontalDirection] ?? deviceData.Device.VaneHorizontalDirection
|
|
80
|
+
deviceData.Device.VaneVerticalDirection = AirConditioner.VaneVerticalDirectionMapStringToEnum[deviceData.Device.VaneVerticalDirection] ?? deviceData.Device.VaneVerticalDirection;
|
|
81
81
|
|
|
82
82
|
//read default temps
|
|
83
83
|
const temps = await this.functions.readData(this.defaultTempsFile, true);
|
|
@@ -201,30 +201,20 @@ class MelCloudAta extends EventEmitter {
|
|
|
201
201
|
const messageType = parsedMessage[0].messageType;
|
|
202
202
|
switch (messageType) {
|
|
203
203
|
case 'unitStateChanged':
|
|
204
|
-
const deviceSettings =
|
|
205
|
-
messageData.settings.map(({ name, value }) => {
|
|
206
|
-
let parsedValue = this.functions.convertValue(value);
|
|
207
|
-
return [name, parsedValue];
|
|
208
|
-
})
|
|
209
|
-
);
|
|
210
|
-
|
|
204
|
+
const deviceSettings = this.functions.parseArrayNameValue(messageData.settings);
|
|
211
205
|
deviceData.Device.Power = deviceSettings.Power ?? deviceData.Device.Power;
|
|
212
206
|
deviceData.Device.OperationMode = deviceSettings.OperationMode ?? deviceData.Device.OperationMode;
|
|
213
207
|
deviceData.Device.RoomTemperature = deviceSettings.RoomTemperature ?? deviceData.Device.RoomTemperature;
|
|
214
208
|
deviceData.Device.SetTemperature = deviceSettings.SetTemperature ?? deviceData.Device.SetTemperature;
|
|
215
209
|
deviceData.Device.ActualFanSpeed = deviceSettings.ActualFanSpeed ?? deviceData.Device.ActualFanSpeed;
|
|
216
210
|
deviceData.Device.SetFanSpeed = deviceSettings.SetFanSpeed ?? deviceData.Device.SetFanSpeed;
|
|
217
|
-
deviceData.Device.VaneVerticalDirection = deviceSettings.VaneVerticalDirection ?? deviceData.Device.VaneVerticalDirection;
|
|
218
211
|
deviceData.Device.VaneHorizontalDirection = deviceSettings.VaneHorizontalDirection ?? deviceData.Device.VaneHorizontalDirection;
|
|
212
|
+
deviceData.Device.VaneVerticalDirection = deviceSettings.VaneVerticalDirection ?? deviceData.Device.VaneVerticalDirection;
|
|
219
213
|
deviceData.HolidayMode.Enabled = deviceSettings.HolidayMode ?? deviceData.HolidayMode.Enabled;
|
|
220
214
|
updateState = true;
|
|
221
215
|
break;
|
|
222
216
|
case 'unitHolidayModeTriggered':
|
|
223
|
-
const holidayModeSettings =
|
|
224
|
-
messageData.settings.map(({ name, value }) => {
|
|
225
|
-
let parsedValue = this.functions.convertValue(value);
|
|
226
|
-
return [name, parsedValue];
|
|
227
|
-
}));
|
|
217
|
+
const holidayModeSettings = this.functions.parseArrayNameValue(messageData.settings);
|
|
228
218
|
deviceData.Device.Power = holidayModeSettings.Power;
|
|
229
219
|
deviceData.HolidayMode.Enabled = holidayModeSettings.HolidayMode;
|
|
230
220
|
deviceData.HolidayMode.Active = messageData.active;
|
package/src/melcloudhome.js
CHANGED
|
@@ -142,7 +142,6 @@ class MelCloudHome extends EventEmitter {
|
|
|
142
142
|
const createDevice = (device, type) => {
|
|
143
143
|
// Settings już kapitalizowane w nazwach
|
|
144
144
|
const settingsArray = device.Settings || [];
|
|
145
|
-
|
|
146
145
|
const settingsObject = Object.fromEntries(
|
|
147
146
|
settingsArray.map(({ name, value }) => {
|
|
148
147
|
let parsedValue = this.functions.convertValue(value);
|