homebridge-melcloud-control 4.10.20-beta.3 → 4.10.20-beta.4
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 +0 -8
- package/src/deviceerv.js +0 -8
- package/src/melcloudata.js +14 -0
- package/src/melclouderv.js +14 -0
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.4",
|
|
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,14 +319,6 @@ 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
|
-
|
|
330
322
|
const payload = { setFanSpeed: clampedValue };
|
|
331
323
|
if (this.logInfo) this.emit('info', `Set fan speed mode: ${AirConditioner.FanSpeedMapEnumToString[clampedValue]}`);
|
|
332
324
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.SetFanSpeed);
|
package/src/deviceerv.js
CHANGED
|
@@ -282,14 +282,6 @@ class DeviceErv extends EventEmitter {
|
|
|
282
282
|
const max = numberOfFanSpeeds;
|
|
283
283
|
const minValue = supportsAutomaticFanSpeed ? 0 : 1;
|
|
284
284
|
const clampedValue = Math.min(Math.max(value, minValue), max);
|
|
285
|
-
|
|
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
285
|
const payload = { setFanSpeed: clampedValue };
|
|
294
286
|
if (this.logInfo) this.emit('info', `Set fan speed mode: ${Ventilation.FanSpeedMapEnumToString[clampedValue]}`);
|
|
295
287
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, payload, Ventilation.EffectiveFlags.SetFanSpeed);
|
package/src/melcloudata.js
CHANGED
|
@@ -210,6 +210,13 @@ class MelCloudAta extends EventEmitter {
|
|
|
210
210
|
default: {
|
|
211
211
|
//compare against the API wrapper's own live-polled state, not the caller's closure-captured (possibly stale) deviceData
|
|
212
212
|
const changes = this.functions.filterChanges(payload, this.deviceData.Device);
|
|
213
|
+
|
|
214
|
+
//Apple Home always resends its own remembered (non-zero) fan speed together with Active when powering on from off
|
|
215
|
+
//Auto (0) can't be represented on that dial, so ignore this phantom value while the unit is off and currently in Auto
|
|
216
|
+
if (changes.setFanSpeed !== undefined && changes.setFanSpeed !== 0 && this.deviceData.Device.Power === false && this.deviceData.Device.SetFanSpeed === 0) {
|
|
217
|
+
delete changes.setFanSpeed;
|
|
218
|
+
}
|
|
219
|
+
|
|
213
220
|
if (Object.keys(changes).length === 0) {
|
|
214
221
|
if (this.logDebug) this.emit('debug', `Ignore send, no changes: ${JSON.stringify(payload)}`);
|
|
215
222
|
return true;
|
|
@@ -311,6 +318,13 @@ class MelCloudAta extends EventEmitter {
|
|
|
311
318
|
default: {
|
|
312
319
|
//compare against the API wrapper's own live-polled state, not the caller's closure-captured (possibly stale) deviceData
|
|
313
320
|
const changes = this.functions.filterChanges(payload, this.deviceData.Device);
|
|
321
|
+
|
|
322
|
+
//Apple Home always resends its own remembered (non-zero) fan speed together with Active when powering on from off
|
|
323
|
+
//Auto (0) can't be represented on that dial, so ignore this phantom value while the unit is off and currently in Auto
|
|
324
|
+
if (changes.setFanSpeed !== undefined && changes.setFanSpeed !== 0 && this.deviceData.Device.Power === false && this.deviceData.Device.SetFanSpeed === 0) {
|
|
325
|
+
delete changes.setFanSpeed;
|
|
326
|
+
}
|
|
327
|
+
|
|
314
328
|
if (Object.keys(changes).length === 0) {
|
|
315
329
|
if (this.logDebug) this.emit('debug', `Ignore send, no changes: ${JSON.stringify(payload)}`);
|
|
316
330
|
return true;
|
package/src/melclouderv.js
CHANGED
|
@@ -185,6 +185,13 @@ class MelCloudErv extends EventEmitter {
|
|
|
185
185
|
default: {
|
|
186
186
|
//compare against the API wrapper's own live-polled state, not the caller's closure-captured (possibly stale) deviceData
|
|
187
187
|
const changes = this.functions.filterChanges(payload, this.deviceData.Device);
|
|
188
|
+
|
|
189
|
+
//Apple Home always resends its own remembered (non-zero) fan speed together with Active when powering on from off
|
|
190
|
+
//Auto (0) can't be represented on that dial, so ignore this phantom value while the unit is off and currently in Auto
|
|
191
|
+
if (changes.setFanSpeed !== undefined && changes.setFanSpeed !== 0 && this.deviceData.Device.Power === false && this.deviceData.Device.SetFanSpeed === 0) {
|
|
192
|
+
delete changes.setFanSpeed;
|
|
193
|
+
}
|
|
194
|
+
|
|
188
195
|
if (Object.keys(changes).length === 0) {
|
|
189
196
|
if (this.logDebug) this.emit('debug', `Ignore send, no changes: ${JSON.stringify(payload)}`);
|
|
190
197
|
return true;
|
|
@@ -276,6 +283,13 @@ class MelCloudErv extends EventEmitter {
|
|
|
276
283
|
default: {
|
|
277
284
|
//compare against the API wrapper's own live-polled state, not the caller's closure-captured (possibly stale) deviceData
|
|
278
285
|
const changes = this.functions.filterChanges(payload, this.deviceData.Device);
|
|
286
|
+
|
|
287
|
+
//Apple Home always resends its own remembered (non-zero) fan speed together with Active when powering on from off
|
|
288
|
+
//Auto (0) can't be represented on that dial, so ignore this phantom value while the unit is off and currently in Auto
|
|
289
|
+
if (changes.setFanSpeed !== undefined && changes.setFanSpeed !== 0 && this.deviceData.Device.Power === false && this.deviceData.Device.SetFanSpeed === 0) {
|
|
290
|
+
delete changes.setFanSpeed;
|
|
291
|
+
}
|
|
292
|
+
|
|
279
293
|
if (Object.keys(changes).length === 0) {
|
|
280
294
|
if (this.logDebug) this.emit('debug', `Ignore send, no changes: ${JSON.stringify(payload)}`);
|
|
281
295
|
return true;
|