Skip to content

Commit

Permalink
release v3.3.17
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Sep 24, 2024
1 parent 257b811 commit 1e0bb2b
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 46 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- do not configure it manually, always using Config UI X
- required Homebridge v2.0.0 and above

## [3.3.17] - (24.09.2024)

## Changes

- fix operation mode for ATA - Thermostat if device go to OFF
- move some error to warn
- cleanup

## [3.3.16] - (23.09.2024)

## Changes
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class MelCloudPlatform {
await airConditioner.start();
};
} catch (error) {
log.error(`Account: ${accountName}, ATA did finish launching error: ${error.message ?? error}`);
log.error(`Account: ${accountName}, ATA did finish launching error: ${error}`);
}

//Heat Pump 1
Expand Down Expand Up @@ -191,7 +191,7 @@ class MelCloudPlatform {
await heatPump.start();
};
} catch (error) {
log.error(`Account: ${accountName}, ATW did finish launching error: ${error.message ?? error}`);
log.error(`Account: ${accountName}, ATW did finish launching error: ${error}`);
}

//Energy Recovery Ventilation 3
Expand Down Expand Up @@ -236,10 +236,10 @@ class MelCloudPlatform {
await energyRecoveryVentilation.start();
};
} catch (error) {
log.error(`Account: ${accountName}, ERV did finish launching error: ${error.message ?? error}`);
log.error(`Account: ${accountName}, ERV did finish launching error: ${error}`);
}
} catch (error) {
log.error(`Account: ${accountName}, did finish launching error: ${error.message ?? error}`);
log.error(`Account: ${accountName}, did finish launching error: ${error}`);
}
};
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "MELCloud Control",
"name": "homebridge-melcloud-control",
"version": "3.3.16",
"version": "3.3.17",
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
"license": "MIT",
"author": "grzegorz914",
Expand Down
17 changes: 9 additions & 8 deletions src/deviceata.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class DeviceAta extends EventEmitter {
try {
await this.setOverExternalIntegration('RESTFul', deviceData, key, value);
} catch (error) {
this.emit('warn', `RESTFul set error: ${error}.`);
this.emit('warn', error);
};
})
.on('debug', (debug) => {
Expand Down Expand Up @@ -165,7 +165,7 @@ class DeviceAta extends EventEmitter {
try {
await this.setOverExternalIntegration('MQTT', deviceData, key, value);
} catch (error) {
this.emit('warn', `MQTT set error: ${error}.`);
this.emit('warn', error);
};
})
.on('debug', (debug) => {
Expand All @@ -180,7 +180,7 @@ class DeviceAta extends EventEmitter {
}

} catch (error) {
this.emit('warn', `External integration start error: ${error.message || error}.`);
this.emit('warn', `External integration start error: ${error}.`);
};
})
.on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
Expand Down Expand Up @@ -324,7 +324,7 @@ class DeviceAta extends EventEmitter {
this.accessory.targetOperationMode = 2;
break;
default:
this.emit('warn', `Received unknown operating mode: ${operationMode}`);
this.emit('warn', `Unknown operating mode: ${operationMode}`);
return
};

Expand Down Expand Up @@ -413,7 +413,8 @@ class DeviceAta extends EventEmitter {
break;
};

this.accessory.currentOperationMode = !power ? 0 : inStandbyMode ? 0 : this.accessory.currentOperationMode;
this.accessory.currentOperationMode = !power ? 0 : this.accessory.currentOperationMode;
this.accessory.targetOperationMode = !power ? 0 : this.accessory.targetOperationMode;
this.accessory.operationModeSetPropsMinValue = 0
this.accessory.operationModeSetPropsMaxValue = modelSupportsAuto && modelSupportsHeat ? 3 : !modelSupportsAuto && modelSupportsHeat ? 2 : modelSupportsAuto && !modelSupportsHeat ? 3 : 2;
this.accessory.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2, 3] : !modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2, 3] : [0, 2];
Expand Down Expand Up @@ -613,7 +614,7 @@ class DeviceAta extends EventEmitter {
this.emit('publishAccessory', accessory);
this.startPrepareAccessory = false;
} catch (error) {
this.emit('error', `Prepare accessory error: ${error.message ?? error}`);
this.emit('error', error);
};
})
.on('message', (message) => {
Expand All @@ -637,7 +638,7 @@ class DeviceAta extends EventEmitter {

return true;
} catch (error) {
throw new Error(`Start error: ${error.message ?? error}`);
throw new Error(`Start error: ${error}`);
};
};

Expand Down Expand Up @@ -1392,7 +1393,7 @@ class DeviceAta extends EventEmitter {

return accessory;
} catch (error) {
throw new Error(error);
throw new Error(`Prepare accessory error: ${error.message || error}`);
};
};
};
Expand Down
14 changes: 7 additions & 7 deletions src/deviceatw.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class DeviceAtw extends EventEmitter {
try {
await this.setOverExternalIntegration('RESTFul', deviceData, key, value);
} catch (error) {
this.emit('warn', `RESTFul set error: ${error}.`);
this.emit('warn', error);
};
})
.on('debug', (debug) => {
Expand Down Expand Up @@ -169,7 +169,7 @@ class DeviceAtw extends EventEmitter {
try {
await this.setOverExternalIntegration('MQTT', deviceData, key, value);
} catch (error) {
this.emit('warn', `MQTT set error: ${error}.`);
this.emit('warn', error);
};
})
.on('debug', (debug) => {
Expand All @@ -183,7 +183,7 @@ class DeviceAtw extends EventEmitter {
const mqtt1 = this.mqttConnected ? this.mqtt1.emit('publish', `State`, deviceData.Device) : false;
}
} catch (error) {
this.emit('warn', `External integration start error: ${error.message || error}.`);
this.emit('warn', `External integration start error: ${error}.`);
};
})
.on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion, hasHotWaterTank, hasZone2) => {
Expand Down Expand Up @@ -781,7 +781,7 @@ class DeviceAtw extends EventEmitter {
button.state = (prohibitZone2 === true);
break;
default: //Unknown button
this.emit('message', `Unknown button mode: ${mode} detected.`);
this.emit('warn', `Unknown button mode: ${mode} detected.`);
break;
};

Expand All @@ -804,7 +804,7 @@ class DeviceAtw extends EventEmitter {
this.emit('publishAccessory', accessory);
this.startPrepareAccessory = false;
} catch (error) {
this.emit('error', `Prepare accessory error: ${error}`);
this.emit('error', error);
};
})
.on('message', (message) => {
Expand All @@ -828,7 +828,7 @@ class DeviceAtw extends EventEmitter {

return true;
} catch (error) {
throw new Error(`start error: ${error}`);
throw new Error(`Start error: ${error}`);
};
};

Expand Down Expand Up @@ -1934,7 +1934,7 @@ class DeviceAtw extends EventEmitter {

return accessory;
} catch (error) {
throw new Error(error.message ?? error);
throw new Error(`Prepare accessory error: ${error.message || error}`);
};
};
};
Expand Down
17 changes: 10 additions & 7 deletions src/deviceerv.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class DeviceErv extends EventEmitter {
try {
await this.setOverExternalIntegration('RESTFul', deviceData, key, value);
} catch (error) {
this.emit('warn', `RESTFul set error: ${error}.`);
this.emit('warn', error);
};
})
.on('debug', (debug) => {
Expand Down Expand Up @@ -163,7 +163,7 @@ class DeviceErv extends EventEmitter {
try {
await this.setOverExternalIntegration('MQTT', deviceData, key, value);
} catch (error) {
this.emit('warn', `MQTT set error: ${error}.`);
this.emit('warn', error);
};
})
.on('debug', (debug) => {
Expand All @@ -177,7 +177,7 @@ class DeviceErv extends EventEmitter {
const mqtt1 = this.mqttConnected ? this.mqtt1.emit('publish', `State`, deviceData.Device) : false;
}
} catch (error) {
this.emit('warn', `External integration start error: ${error.message || error}.`);
this.emit('warn', `External integration start error: ${error}.`);
};
})
.on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
Expand Down Expand Up @@ -381,6 +381,9 @@ class DeviceErv extends EventEmitter {
};
this.accessory.targetOperationMode = 3;
break;
default:
this.emit('warn', `Unknown ventilation mode: ${ventilationMode}`);
break;
};

this.accessory.currentOperationMode = !power ? 0 : this.accessory.currentOperationMode;
Expand Down Expand Up @@ -512,7 +515,7 @@ class DeviceErv extends EventEmitter {
button.state = (hideOutdoorTemperature === true);
break;
default: //Unknown button
this.emit('message', `Unknown button mode: ${mode} detected.`);
this.emit('warn', `Unknown button mode: ${mode} detected.`);
break;
};

Expand Down Expand Up @@ -554,7 +557,7 @@ class DeviceErv extends EventEmitter {
this.emit('publishAccessory', accessory);
this.startPrepareAccessory = false;
} catch (error) {
this.emit('error', `Prepare accessory error: ${error}`);
this.emit('error', error);
};
})
.on('message', (message) => {
Expand All @@ -578,7 +581,7 @@ class DeviceErv extends EventEmitter {

return true;
} catch (error) {
throw new Error(`start error: ${error}`);
throw new Error(`Start error: ${error}`);
};
};

Expand Down Expand Up @@ -1251,7 +1254,7 @@ class DeviceErv extends EventEmitter {

return accessory;
} catch (error) {
throw new Error(error.message ?? error);
throw new Error(`Prepare accessory error: ${error.message || error}`);
};
};
};
Expand Down
10 changes: 5 additions & 5 deletions src/melcloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MelCloud extends EventEmitter {
try {
await this.chackDevicesList(this.contextKey);
} catch (error) {
this.emit('error', `Check devices list: ${error}.`);
this.emit('error', `Impulse generator error: ${error}.`);
};
}).on('state', (state) => { });
};
Expand Down Expand Up @@ -114,7 +114,7 @@ class MelCloud extends EventEmitter {

return obj;
} catch (error) {
throw new Error(`Connect to MELCloud error: ${error.message ?? error}.`);
throw new Error(`Connect to MELCloud error: ${error.message || error}.`);
};
}

Expand Down Expand Up @@ -179,7 +179,7 @@ class MelCloud extends EventEmitter {

return devices;
} catch (error) {
throw new Error(`Scanning for devices error: ${error.message ?? error}.`);
throw new Error(`Check devices list error: ${error.message || error}.`);
};
}

Expand All @@ -189,7 +189,7 @@ class MelCloud extends EventEmitter {
const debug3 = this.enableDebugMode ? this.emit('debug', `Data saved to: ${path}.`) : false;
return true;
} catch (error) {
throw new Error(`Save data error: ${error.message ?? error}`);
throw new Error(`Save data error: ${error.message || error}`);
}
}

Expand All @@ -203,7 +203,7 @@ class MelCloud extends EventEmitter {
await this.saveData(this.accountFile, accountInfo);
return true;
} catch (error) {
throw new Error(error.message ?? error);
throw new Error(`Send data error: ${error.message || error}`);
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions src/melcloudata.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MelCloudAta extends EventEmitter {
try {
await this.checkState();
} catch (error) {
this.emit('error', `Impulse generator check state error: ${error.message || error}.`);
this.emit('error', `Impulse generator error: ${error}.`);
};
}).on('state', (state) => { });
};
Expand Down Expand Up @@ -363,7 +363,7 @@ class MelCloudAta extends EventEmitter {
const data = savedData.length > 0 ? JSON.parse(savedData) : false;
return data;
} catch (error) {
throw new Error(`Read data error: ${error.message ?? error}`);
throw new Error(`Read data error: ${error.message || error}`);
}
}

Expand Down Expand Up @@ -432,7 +432,7 @@ class MelCloudAta extends EventEmitter {
this.emit('deviceState', deviceData);
return true;
} catch (error) {
throw new Error(error.message ?? error);
throw new Error(`Send data error: ${error.message || error}`);
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions src/melcloudatw.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MelCloudAtw extends EventEmitter {
try {
await this.checkState();
} catch (error) {
this.emit('error', `Impulse generator check state error: ${error.message || error}.`);
this.emit('error', `Impulse generator error: ${error}.`);
};
}).on('state', (state) => { });
};
Expand Down Expand Up @@ -427,7 +427,7 @@ class MelCloudAtw extends EventEmitter {
const data = savedData.length > 0 ? JSON.parse(savedData) : false;
return data;
} catch (error) {
throw new Error(`Read data error: ${error.message ?? error}`);
throw new Error(`Read data error: ${error.message || error}`);
}
}

Expand Down Expand Up @@ -483,7 +483,7 @@ class MelCloudAtw extends EventEmitter {
this.emit('deviceState', deviceData);
return true;
} catch (error) {
throw new Error(error.message ?? error);
throw new Error(`Send data error: ${error.message || error}`);
};
};
};
Expand Down
7 changes: 4 additions & 3 deletions src/melclouderv.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MelCloudErv extends EventEmitter {
try {
await this.checkState();
} catch (error) {
this.emit('error', `Impulse generator check state error: ${error.message || error}.`);
this.emit('error', `Impulse generator error: ${error}.`);
};
}).on('state', (state) => { });
};
Expand Down Expand Up @@ -351,9 +351,10 @@ class MelCloudErv extends EventEmitter {
const data = savedData.length > 0 ? JSON.parse(savedData) : false;
return data;;
} catch (error) {
throw new Error(`Read data error: ${error.message ?? error}`);
throw new Error(`Read data error: ${error.message || error}`);
}
}

async send(deviceData, displayMode) {
try {
//set target temp based on display mode and ventilation mode
Expand Down Expand Up @@ -404,7 +405,7 @@ class MelCloudErv extends EventEmitter {
this.emit('deviceState', deviceData);
return true;
} catch (error) {
throw new Error(error.message ?? error);
throw new Error(`Send data error: ${error.message || error}`);
};
};
};
Expand Down
Loading

0 comments on commit 1e0bb2b

Please sign in to comment.