homebridge-melcloud-control 4.10.7 → 4.10.8-beta.0

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/index.js CHANGED
@@ -211,7 +211,8 @@ class MelCloudPlatform {
211
211
  const buttons = (device.buttonsSensors || []).filter(b => (b.displayType ?? 0) > 0);
212
212
 
213
213
  // Store port on device — never mutate the shared account object
214
- account.restFul.port = type === 'melcloudhome'
214
+ device.restFul = { ...(account.restFul ?? {}) };
215
+ device.restFul.port = type === 'melcloudhome'
215
216
  ? `${3000}${index}`
216
217
  : (device.id).slice(-4).replace(/^0/, '9');
217
218
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.10.7",
4
+ "version": "4.10.8-beta.0",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -37,11 +37,11 @@
37
37
  "dependencies": {
38
38
  "@homebridge/plugin-ui-utils": "^2.2.3",
39
39
  "mqtt": "^5.15.1",
40
- "axios": "^1.16.0",
40
+ "axios": "^1.16.1",
41
41
  "axios-cookiejar-support": "^7.0.0",
42
42
  "tough-cookie": "^6.0.1",
43
43
  "express": "^5.2.1",
44
- "ws": "^8.20.0"
44
+ "ws": "^8.21.0"
45
45
  },
46
46
  "keywords": [
47
47
  "homebridge",
package/src/deviceata.js CHANGED
@@ -59,8 +59,7 @@ class DeviceAta extends EventEmitter {
59
59
  this.melCloudAccountData = melCloudAccountData;
60
60
 
61
61
  //external integrations
62
- this.restFul = account.restFul ?? {};
63
- this.restFul.port = device.restFulPort;
62
+ this.restFul = device.restFul ?? {};
64
63
  this.restFulConnected = false;
65
64
  this.mqtt = account.mqtt ?? {};
66
65
  this.mqttConnected = false;
@@ -432,7 +431,8 @@ class DeviceAta extends EventEmitter {
432
431
  minStep: this.accessory.temperatureStep
433
432
  })
434
433
  .onGet(async () => {
435
- const value = this.accessory.operationMode === 8 ? this.accessory.defaultCoolingSetTemperature : this.accessory.setTemperature;
434
+ const raw = this.accessory.operationMode === 8 ? this.accessory.defaultCoolingSetTemperature : this.accessory.setTemperature;
435
+ const value = Math.max(raw, this.accessory.minSetCoolDryAutoRoomTemperature);
436
436
  return value;
437
437
  })
438
438
  .onSet(async (value) => {
@@ -453,7 +453,8 @@ class DeviceAta extends EventEmitter {
453
453
  minStep: this.accessory.temperatureStep
454
454
  })
455
455
  .onGet(async () => {
456
- const value = this.accessory.operationMode === 8 ? this.accessory.defaultHeatingSetTemperature : this.accessory.setTemperature;
456
+ const raw = this.accessory.operationMode === 8 ? this.accessory.defaultHeatingSetTemperature : this.accessory.setTemperature;
457
+ const value = Math.max(raw, this.accessory.minSetHeatRoomTemperature);
457
458
  return value;
458
459
  })
459
460
  .onSet(async (value) => {
@@ -568,7 +569,7 @@ class DeviceAta extends EventEmitter {
568
569
  minStep: this.accessory.temperatureStep
569
570
  })
570
571
  .onGet(async () => {
571
- const value = this.accessory.setTemperature;
572
+ const value = Math.max(this.accessory.setTemperature, this.accessory.minSetCoolDryAutoRoomTemperature);
572
573
  return value;
573
574
  })
574
575
  .onSet(async (value) => {
@@ -1399,10 +1400,10 @@ class DeviceAta extends EventEmitter {
1399
1400
 
1400
1401
  //sensor
1401
1402
  if (button.displayType < 7) {
1402
- this.emit('debug', `Prepare button control sensor ${name} service`);
1403
- const buttonControlSensorService = new serviceType(serviceName, `buttonControlSensorService${deviceId} ${i}`);
1403
+ if (this.logDebug) this.emit('debug', `Prepare button control sensor ${name} service`);
1404
+ const buttonControlSensorService = new serviceType(serviceName1, `buttonControlSensorService${deviceId} ${i}`);
1404
1405
  buttonControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1405
- buttonControlSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
1406
+ buttonControlSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
1406
1407
  buttonControlSensorService.getCharacteristic(characteristicType)
1407
1408
  .onGet(async () => {
1408
1409
  const state = button.state;
@@ -1663,10 +1664,10 @@ class DeviceAta extends EventEmitter {
1663
1664
  { type: Characteristic.CurrentTemperature, value: roomTemperature },
1664
1665
  { type: Characteristic.LockPhysicalControls, value: obj.lockPhysicalControl },
1665
1666
  { type: Characteristic.TemperatureDisplayUnits, value: obj.useFahrenheit },
1666
- { type: Characteristic.CoolingThresholdTemperature, value: operationMode === 8 ? defaultCoolingSetTemperature : setTemperature }
1667
+ { type: Characteristic.CoolingThresholdTemperature, value: Math.max(operationMode === 8 ? defaultCoolingSetTemperature : setTemperature, minSetCoolDryAutoRoomTemperature) }
1667
1668
  );
1668
1669
 
1669
- if (supportsHeat) characteristics.push({ type: Characteristic.HeatingThresholdTemperature, value: operationMode === 8 ? defaultHeatingSetTemperature : setTemperature });
1670
+ if (supportsHeat) characteristics.push({ type: Characteristic.HeatingThresholdTemperature, value: Math.max(operationMode === 8 ? defaultHeatingSetTemperature : setTemperature, minSetHeatRoomTemperature) });
1670
1671
  if (supportsFanSpeed) characteristics.push({ type: Characteristic.RotationSpeed, value: obj.currentFanSpeed });
1671
1672
  if (supportsSwingFunction) characteristics.push({ type: Characteristic.SwingMode, value: obj.currentSwingMode });
1672
1673
  break;
@@ -1731,7 +1732,7 @@ class DeviceAta extends EventEmitter {
1731
1732
  { type: Characteristic.CurrentHeatingCoolingState, value: obj.currentOperationMode },
1732
1733
  { type: Characteristic.TargetHeatingCoolingState, value: obj.targetOperationMode },
1733
1734
  { type: Characteristic.CurrentTemperature, value: roomTemperature },
1734
- { type: Characteristic.TargetTemperature, value: setTemperature },
1735
+ { type: Characteristic.TargetTemperature, value: Math.max(setTemperature, minSetCoolDryAutoRoomTemperature) },
1735
1736
  { type: Characteristic.TemperatureDisplayUnits, value: obj.useFahrenheit }
1736
1737
  );
1737
1738
  break;
package/src/deviceatw.js CHANGED
@@ -66,8 +66,7 @@ class DeviceAtw extends EventEmitter {
66
66
  this.melCloudAccountData = melCloudAccountData;
67
67
 
68
68
  //external integrations
69
- this.restFul = account.restFul ?? {};
70
- this.restFul.port = device.restFulPort;
69
+ this.restFul = device.restFul ?? {};
71
70
  this.restFulConnected = false;
72
71
  this.mqtt = account.mqtt ?? {};
73
72
  this.mqttConnected = false;
@@ -475,7 +474,7 @@ class DeviceAtw extends EventEmitter {
475
474
  minStep: this.accessory.temperatureIncrement
476
475
  })
477
476
  .onGet(async () => {
478
- const value = zone.setTemperature;
477
+ const value = Math.max(zone.setTemperature, zone.temperaturesSetPropsMinValue);
479
478
  return value;
480
479
  })
481
480
  .onSet(async (value) => {
@@ -563,7 +562,7 @@ class DeviceAtw extends EventEmitter {
563
562
  minStep: this.accessory.temperatureIncrement
564
563
  })
565
564
  .onGet(async () => {
566
- const value = zone.setTemperature;
565
+ const value = Math.max(zone.setTemperature, zone.temperaturesSetPropsMinValue);
567
566
  return value;
568
567
  })
569
568
  .onSet(async (value) => {
@@ -831,7 +830,7 @@ class DeviceAtw extends EventEmitter {
831
830
  minStep: this.accessory.temperatureIncrement
832
831
  })
833
832
  .onGet(async () => {
834
- const value = zone.setTemperature;
833
+ const value = Math.max(zone.setTemperature, zone.temperaturesSetPropsMinValue);
835
834
  return value;
836
835
  })
837
836
  .onSet(async (value) => {
@@ -2117,8 +2116,8 @@ class DeviceAtw extends EventEmitter {
2117
2116
  { type: Characteristic.TemperatureDisplayUnits, value: obj.useFahrenheit }
2118
2117
  );
2119
2118
 
2120
- if (heatCoolModes === 0 || heatCoolModes === 1) characteristics.push({ type: Characteristic.HeatingThresholdTemperature, value: setTemperature });
2121
- if ((heatCoolModes === 0 || heatCoolModes === 2) && i !== caseHotWater) characteristics.push({ type: Characteristic.CoolingThresholdTemperature, value: setTemperature });
2119
+ if (heatCoolModes === 0 || heatCoolModes === 1) characteristics.push({ type: Characteristic.HeatingThresholdTemperature, value: Math.max(setTemperature, temperatureSetPropsMinValue) });
2120
+ if ((heatCoolModes === 0 || heatCoolModes === 2) && i !== caseHotWater) characteristics.push({ type: Characteristic.CoolingThresholdTemperature, value: Math.max(setTemperature, temperatureSetPropsMinValue) });
2122
2121
  break;
2123
2122
  case 2: //Thermostat
2124
2123
  switch (i) {
@@ -2272,7 +2271,7 @@ class DeviceAtw extends EventEmitter {
2272
2271
  { type: Characteristic.CurrentHeatingCoolingState, value: currentOperationMode },
2273
2272
  { type: Characteristic.TargetHeatingCoolingState, value: targetOperationMode },
2274
2273
  { type: Characteristic.CurrentTemperature, value: roomTemperature },
2275
- { type: Characteristic.TargetTemperature, value: setTemperature },
2274
+ { type: Characteristic.TargetTemperature, value: Math.max(setTemperature, temperatureSetPropsMinValue) },
2276
2275
  { type: Characteristic.TemperatureDisplayUnits, value: obj.useFahrenheit }
2277
2276
  );
2278
2277
  break;
package/src/deviceerv.js CHANGED
@@ -54,8 +54,7 @@ class DeviceErv extends EventEmitter {
54
54
  this.melCloudAccountData = melCloudAccountData;
55
55
 
56
56
  //external integrations
57
- this.restFul = account.restFul ?? {};
58
- this.restFul.port = device.restFulPort;
57
+ this.restFul = device.restFul ?? {};
59
58
  this.restFulConnected = false;
60
59
  this.mqtt = account.mqtt ?? {};
61
60
  this.mqttConnected = false;
@@ -379,7 +378,8 @@ class DeviceErv extends EventEmitter {
379
378
  minStep: this.accessory.temperatureIncrement
380
379
  })
381
380
  .onGet(async () => {
382
- const value = this.accessory.ventilationMode === 2 ? this.accessory.defaultHeatingSetTemperature : this.accessory.setTemperature;
381
+ const raw = this.accessory.ventilationMode === 2 ? this.accessory.defaultHeatingSetTemperature : this.accessory.setTemperature;
382
+ const value = Math.max(raw, this.accessory.minTempCoolDryAuto);
383
383
  return value;
384
384
  })
385
385
  .onSet(async (value) => {
@@ -402,7 +402,8 @@ class DeviceErv extends EventEmitter {
402
402
  minStep: this.accessory.temperatureIncrement
403
403
  })
404
404
  .onGet(async () => {
405
- const value = this.accessory.ventilationMode === 2 ? this.accessory.defaultHeatingSetTemperature : this.accessory.setTemperature;
405
+ const raw = this.accessory.ventilationMode === 2 ? this.accessory.defaultHeatingSetTemperature : this.accessory.setTemperature;
406
+ const value = Math.max(raw, this.accessory.minTempHeat);
406
407
  return value;
407
408
  })
408
409
  .onSet(async (value) => {
@@ -497,7 +498,7 @@ class DeviceErv extends EventEmitter {
497
498
  minStep: this.accessory.temperatureIncrement
498
499
  })
499
500
  .onGet(async () => {
500
- const value = this.accessory.setTemperature;
501
+ const value = Math.max(this.accessory.setTemperature, this.accessory.minTempHeat);
501
502
  return value;
502
503
  })
503
504
  .onSet(async (value) => {
@@ -1297,8 +1298,8 @@ class DeviceErv extends EventEmitter {
1297
1298
  );
1298
1299
 
1299
1300
  if (supportsFanSpeed) characteristics.push({ type: Characteristic.RotationSpeed, value: obj.fanSpeed });
1300
- if (supportsCoolOperationMode) characteristics.push({ type: Characteristic.CoolingThresholdTemperature, value: ventilationMode === 2 ? defaultCoolingSetTemperature : setTemperature });
1301
- if (supportsHeatOperationMode) characteristics.push({ type: Characteristic.HeatingThresholdTemperature, value: ventilationMode === 2 ? defaultHeatingSetTemperature : setTemperature });
1301
+ if (supportsCoolOperationMode) characteristics.push({ type: Characteristic.CoolingThresholdTemperature, value: Math.max(ventilationMode === 2 ? defaultCoolingSetTemperature : setTemperature, minTempCoolDryAuto) });
1302
+ if (supportsHeatOperationMode) characteristics.push({ type: Characteristic.HeatingThresholdTemperature, value: Math.max(ventilationMode === 2 ? defaultHeatingSetTemperature : setTemperature, minTempHeat) });
1302
1303
  break;
1303
1304
  case 2: //Thermostat
1304
1305
  //operation mode - 0, HEAT, 2, COOL, 4, 5, 6, FAN, AUTO
@@ -1343,7 +1344,7 @@ class DeviceErv extends EventEmitter {
1343
1344
  { type: Characteristic.CurrentHeatingCoolingState, value: obj.currentOperationMode },
1344
1345
  { type: Characteristic.TargetHeatingCoolingState, value: obj.targetOperationMode },
1345
1346
  { type: Characteristic.CurrentTemperature, value: roomTemperature },
1346
- { type: Characteristic.TargetTemperature, value: setTemperature },
1347
+ { type: Characteristic.TargetTemperature, value: Math.max(setTemperature, minTempHeat) },
1347
1348
  { type: Characteristic.TemperatureDisplayUnits, value: obj.useFahrenheit },
1348
1349
  );
1349
1350
  break;