homebridge-melcloud-control 4.3.3-beta.13 → 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/deviceata.js +1 -1
- package/src/deviceatw.js +1 -1
- package/src/deviceerv.js +1 -1
- package/src/functions.js +8 -0
- package/src/melcloudata.js +14 -24
- 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/deviceata.js
CHANGED
|
@@ -915,7 +915,7 @@ class DeviceAta extends EventEmitter {
|
|
|
915
915
|
presetControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${serviceName1} Control`);
|
|
916
916
|
presetControlSensorService.getCharacteristic(characteristicType)
|
|
917
917
|
.onGet(async () => {
|
|
918
|
-
const state =
|
|
918
|
+
const state = preset.state;
|
|
919
919
|
return state;
|
|
920
920
|
})
|
|
921
921
|
this.presetControlSensorServices.push(presetControlSensorService);
|
package/src/deviceatw.js
CHANGED
|
@@ -1230,7 +1230,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1230
1230
|
presetControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${serviceName1} Control`);
|
|
1231
1231
|
presetControlSensorService.getCharacteristic(characteristicType)
|
|
1232
1232
|
.onGet(async () => {
|
|
1233
|
-
const state =
|
|
1233
|
+
const state = preset.state;
|
|
1234
1234
|
return state;
|
|
1235
1235
|
})
|
|
1236
1236
|
this.presetControlSensorServices.push(presetControlSensorService);
|
package/src/deviceerv.js
CHANGED
|
@@ -842,7 +842,7 @@ class DeviceErv extends EventEmitter {
|
|
|
842
842
|
presetControlSensorService.setCharacteristic(Characteristic.ConfiguredName, `${serviceName1} Control`);
|
|
843
843
|
presetControlSensorService.getCharacteristic(characteristicType)
|
|
844
844
|
.onGet(async () => {
|
|
845
|
-
const state =
|
|
845
|
+
const state = preset.state;
|
|
846
846
|
return state;
|
|
847
847
|
})
|
|
848
848
|
this.presetControlSensorServices.push(presetControlSensorService);
|
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,33 +201,23 @@ class MelCloudAta extends EventEmitter {
|
|
|
201
201
|
const messageType = parsedMessage[0].messageType;
|
|
202
202
|
switch (messageType) {
|
|
203
203
|
case 'unitStateChanged':
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
deviceData.Device.
|
|
212
|
-
deviceData.Device.
|
|
213
|
-
deviceData.
|
|
214
|
-
deviceData.Device.SetTemperature = settings.SetTemperature ?? deviceData.Device.SetTemperature;
|
|
215
|
-
deviceData.Device.ActualFanSpeed = settings.ActualFanSpeed ?? deviceData.Device.ActualFanSpeed;
|
|
216
|
-
deviceData.Device.SetFanSpeed = settings.SetFanSpeed ?? deviceData.Device.SetFanSpeed;
|
|
217
|
-
deviceData.Device.VaneVerticalDirection = settings.VaneVerticalDirection ?? deviceData.Device.VaneVerticalDirection;
|
|
218
|
-
deviceData.Device.VaneHorizontalDirection = settings.VaneHorizontalDirection ?? deviceData.Device.VaneHorizontalDirection;
|
|
219
|
-
deviceData.HolidayMode.Enabled = settings.HolidayMode ?? deviceData.HolidayMode.Enabled;
|
|
204
|
+
const deviceSettings = this.functions.parseArrayNameValue(messageData.settings);
|
|
205
|
+
deviceData.Device.Power = deviceSettings.Power ?? deviceData.Device.Power;
|
|
206
|
+
deviceData.Device.OperationMode = deviceSettings.OperationMode ?? deviceData.Device.OperationMode;
|
|
207
|
+
deviceData.Device.RoomTemperature = deviceSettings.RoomTemperature ?? deviceData.Device.RoomTemperature;
|
|
208
|
+
deviceData.Device.SetTemperature = deviceSettings.SetTemperature ?? deviceData.Device.SetTemperature;
|
|
209
|
+
deviceData.Device.ActualFanSpeed = deviceSettings.ActualFanSpeed ?? deviceData.Device.ActualFanSpeed;
|
|
210
|
+
deviceData.Device.SetFanSpeed = deviceSettings.SetFanSpeed ?? deviceData.Device.SetFanSpeed;
|
|
211
|
+
deviceData.Device.VaneHorizontalDirection = deviceSettings.VaneHorizontalDirection ?? deviceData.Device.VaneHorizontalDirection;
|
|
212
|
+
deviceData.Device.VaneVerticalDirection = deviceSettings.VaneVerticalDirection ?? deviceData.Device.VaneVerticalDirection;
|
|
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
|
-
}));
|
|
228
|
-
deviceData.HolidayMode.Active = messageData.active;
|
|
229
|
-
deviceData.HolidayMode.Enabled = holidayModeSettings.HolidayMode;
|
|
217
|
+
const holidayModeSettings = this.functions.parseArrayNameValue(messageData.settings);
|
|
230
218
|
deviceData.Device.Power = holidayModeSettings.Power;
|
|
219
|
+
deviceData.HolidayMode.Enabled = holidayModeSettings.HolidayMode;
|
|
220
|
+
deviceData.HolidayMode.Active = messageData.active;
|
|
231
221
|
updateState = true;
|
|
232
222
|
break;
|
|
233
223
|
case 'unitWifiSignalChanged':
|
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);
|