homebridge-melcloud-control 4.10.20-beta.2 → 4.10.20-beta.3
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 -0
- package/src/deviceerv.js +10 -4
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.20-beta.
|
|
4
|
+
"version": "4.10.20-beta.3",
|
|
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
|
@@ -319,6 +319,14 @@ class DeviceAta extends EventEmitter {
|
|
|
319
319
|
const max = numberOfFanSpeeds;
|
|
320
320
|
const minValue = supportsAutomaticFanSpeed ? 0 : 1;
|
|
321
321
|
const clampedValue = Math.min(Math.max(value, minValue), max);
|
|
322
|
+
|
|
323
|
+
//Apple Home always resends its own remembered (non-zero) fan speed together with Active when powering on from off
|
|
324
|
+
//Auto (0) can't be represented on that dial, so ignore this phantom value while the unit is off and currently in Auto
|
|
325
|
+
if (!this.accessory.power && this.accessory.currentFanSpeed === 0 && clampedValue !== 0) {
|
|
326
|
+
if (this.logDebug) this.emit('debug', `Ignore set fan speed while powering on from Auto: ${clampedValue}`);
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
|
|
322
330
|
const payload = { setFanSpeed: clampedValue };
|
|
323
331
|
if (this.logInfo) this.emit('info', `Set fan speed mode: ${AirConditioner.FanSpeedMapEnumToString[clampedValue]}`);
|
|
324
332
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.SetFanSpeed);
|
package/src/deviceerv.js
CHANGED
|
@@ -274,17 +274,23 @@ class DeviceErv extends EventEmitter {
|
|
|
274
274
|
minStep: 1
|
|
275
275
|
})
|
|
276
276
|
.onGet(async () => {
|
|
277
|
-
const value = this.accessory.
|
|
277
|
+
const value = this.accessory.currentFanSpeed;
|
|
278
278
|
return value;
|
|
279
279
|
})
|
|
280
280
|
.onSet(async (value) => {
|
|
281
281
|
try {
|
|
282
|
-
const payload = {};
|
|
283
282
|
const max = numberOfFanSpeeds;
|
|
284
283
|
const minValue = supportsAutomaticFanSpeed ? 0 : 1;
|
|
285
284
|
const clampedValue = Math.min(Math.max(value, minValue), max);
|
|
286
285
|
|
|
287
|
-
|
|
286
|
+
//Apple Home always resends its own remembered (non-zero) fan speed together with Active when powering on from off
|
|
287
|
+
//Auto (0) can't be represented on that dial, so ignore this phantom value while the unit is off and currently in Auto
|
|
288
|
+
if (!this.accessory.power && this.accessory.currentFanSpeed === 0 && clampedValue !== 0) {
|
|
289
|
+
if (this.logDebug) this.emit('debug', `Ignore set fan speed while powering on from Auto: ${clampedValue}`);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const payload = { setFanSpeed: clampedValue };
|
|
288
294
|
if (this.logInfo) this.emit('info', `Set fan speed mode: ${Ventilation.FanSpeedMapEnumToString[clampedValue]}`);
|
|
289
295
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, payload, Ventilation.EffectiveFlags.SetFanSpeed);
|
|
290
296
|
} catch (error) {
|
|
@@ -1215,7 +1221,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1215
1221
|
{ type: Characteristic.TemperatureDisplayUnits, value: obj.useFahrenheit },
|
|
1216
1222
|
);
|
|
1217
1223
|
|
|
1218
|
-
if (supportsFanSpeed) characteristics.push({ type: Characteristic.RotationSpeed, value: obj.
|
|
1224
|
+
if (supportsFanSpeed) characteristics.push({ type: Characteristic.RotationSpeed, value: obj.currentFanSpeed });
|
|
1219
1225
|
if (supportsCoolOperationMode) characteristics.push({ type: Characteristic.CoolingThresholdTemperature, value: Math.max(ventilationMode === 2 ? defaultCoolingSetTemperature : setTemperature, minTempCoolDryAuto) });
|
|
1220
1226
|
if (supportsHeatOperationMode) characteristics.push({ type: Characteristic.HeatingThresholdTemperature, value: Math.max(ventilationMode === 2 ? defaultHeatingSetTemperature : setTemperature, minTempHeat) });
|
|
1221
1227
|
break;
|