homebridge-melcloud-control 4.3.11-beta.5 → 4.3.11-beta.7
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 +1 -1
- package/src/deviceatw.js +1 -1
- package/src/deviceerv.js +1 -1
- package/src/melcloud.js +2 -2
- package/src/melcloudata.js +2 -3
- package/src/melcloudatw.js +2 -2
- package/src/melclouderv.js +2 -2
- package/src/melcloudhome.js +6 -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.3.11-beta.
|
|
4
|
+
"version": "4.3.11-beta.7",
|
|
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
|
@@ -1325,7 +1325,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1325
1325
|
async start() {
|
|
1326
1326
|
try {
|
|
1327
1327
|
//melcloud device
|
|
1328
|
-
this.melCloudAta = new MelCloudAta(this.account, this.device, this.defaultTempsFile, this.accountFile, this.melcloud
|
|
1328
|
+
this.melCloudAta = new MelCloudAta(this.account, this.device, this.defaultTempsFile, this.accountFile, this.melcloud)
|
|
1329
1329
|
.on('deviceInfo', (modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
|
|
1330
1330
|
if (this.logDeviceInfo && this.displayDeviceInfo) {
|
|
1331
1331
|
this.emit('devInfo', `---- ${this.deviceTypeString}: ${this.deviceName} ----`);
|
package/src/deviceatw.js
CHANGED
|
@@ -1567,7 +1567,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1567
1567
|
async start() {
|
|
1568
1568
|
try {
|
|
1569
1569
|
//melcloud device
|
|
1570
|
-
this.melCloudAtw = new MelCloudAtw(this.account, this.device, this.defaultTempsFile, this.accountFile, this.melcloud
|
|
1570
|
+
this.melCloudAtw = new MelCloudAtw(this.account, this.device, this.defaultTempsFile, this.accountFile, this.melcloud)
|
|
1571
1571
|
.on('deviceInfo', (modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion, supportsHotWaterTank, supportsZone2) => {
|
|
1572
1572
|
if (this.logDeviceInfo && this.displayDeviceInfo) {
|
|
1573
1573
|
this.emit('devInfo', `---- ${this.deviceTypeString}: ${this.deviceName} ----`);
|
package/src/deviceerv.js
CHANGED
|
@@ -1121,7 +1121,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1121
1121
|
async start() {
|
|
1122
1122
|
try {
|
|
1123
1123
|
//melcloud device
|
|
1124
|
-
this.melCloudErv = new MelCloudErv(this.account, this.device, this.defaultTempsFile, this.accountFile, this.melcloud
|
|
1124
|
+
this.melCloudErv = new MelCloudErv(this.account, this.device, this.defaultTempsFile, this.accountFile, this.melcloud)
|
|
1125
1125
|
.on('deviceInfo', (modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
|
|
1126
1126
|
if (this.logDeviceInfo && this.displayDeviceInfo) {
|
|
1127
1127
|
this.emit('devInfo', `---- ${this.deviceTypeString}: ${this.deviceName} ----`);
|
package/src/melcloud.js
CHANGED
|
@@ -121,7 +121,7 @@ class MelCloud extends EventEmitter {
|
|
|
121
121
|
if (this.logDebug) this.emit('debug', `Connecting to MELCloud`);
|
|
122
122
|
|
|
123
123
|
try {
|
|
124
|
-
const accountInfo = { State: false, Info: '', Account: null, UseFahrenheit: false
|
|
124
|
+
const accountInfo = { State: false, Info: '', Account: null, UseFahrenheit: false }
|
|
125
125
|
|
|
126
126
|
const payload = {
|
|
127
127
|
Email: this.user,
|
|
@@ -163,6 +163,7 @@ class MelCloud extends EventEmitter {
|
|
|
163
163
|
'Content-Type': 'application/json'
|
|
164
164
|
};
|
|
165
165
|
this.emit('headers', headers);
|
|
166
|
+
|
|
166
167
|
this.headers = headers;
|
|
167
168
|
this.axiosInstance = axios.create({
|
|
168
169
|
baseURL: ApiUrls.BaseURL,
|
|
@@ -174,7 +175,6 @@ class MelCloud extends EventEmitter {
|
|
|
174
175
|
accountInfo.Info = 'Connect Success';
|
|
175
176
|
accountInfo.UseFahrenheit = loginData.UseFahrenheit;
|
|
176
177
|
accountInfo.Account = account;
|
|
177
|
-
accountInfo.Headers = headers;
|
|
178
178
|
await this.functions.saveData(this.accountFile, accountInfo);
|
|
179
179
|
|
|
180
180
|
return accountInfo
|
package/src/melcloudata.js
CHANGED
|
@@ -4,7 +4,7 @@ import Functions from './functions.js';
|
|
|
4
4
|
import { ApiUrls, ApiUrlsHome, AirConditioner } from './constants.js';
|
|
5
5
|
|
|
6
6
|
class MelCloudAta extends EventEmitter {
|
|
7
|
-
constructor(account, device, defaultTempsFile, accountFile, melcloud
|
|
7
|
+
constructor(account, device, defaultTempsFile, accountFile, melcloud) {
|
|
8
8
|
super();
|
|
9
9
|
this.accountType = account.type;
|
|
10
10
|
this.logSuccess = account.log?.success;
|
|
@@ -24,7 +24,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
24
24
|
|
|
25
25
|
//set default values
|
|
26
26
|
this.deviceData = {};
|
|
27
|
-
this.headers =
|
|
27
|
+
this.headers = melcloud.headers;
|
|
28
28
|
|
|
29
29
|
//handle melcloud events
|
|
30
30
|
let deviceData = null;
|
|
@@ -32,7 +32,6 @@ class MelCloudAta extends EventEmitter {
|
|
|
32
32
|
this.headers = headers;
|
|
33
33
|
}).on('devicesList', async (devicesData) => {
|
|
34
34
|
try {
|
|
35
|
-
this.emit('debug', `Headers: ${JSON.stringify(melcloud.Headers, null, 2)}`);
|
|
36
35
|
deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
|
|
37
36
|
if (!deviceData) return;
|
|
38
37
|
deviceData.Scenes = devicesData.Scenes ?? [];
|
package/src/melcloudatw.js
CHANGED
|
@@ -4,7 +4,7 @@ import Functions from './functions.js';
|
|
|
4
4
|
import { ApiUrls, ApiUrlsHome, HeatPump } from './constants.js';
|
|
5
5
|
|
|
6
6
|
class MelCloudAtw extends EventEmitter {
|
|
7
|
-
constructor(account, device, defaultTempsFile, accountFile, melcloud
|
|
7
|
+
constructor(account, device, defaultTempsFile, accountFile, melcloud) {
|
|
8
8
|
super();
|
|
9
9
|
this.accountType = account.type;
|
|
10
10
|
this.logSuccess = account.log?.success;
|
|
@@ -24,7 +24,7 @@ class MelCloudAtw extends EventEmitter {
|
|
|
24
24
|
|
|
25
25
|
//set default values
|
|
26
26
|
this.deviceData = {};
|
|
27
|
-
this.headers =
|
|
27
|
+
this.headers = melcloud.headers;
|
|
28
28
|
|
|
29
29
|
//handle melcloud events
|
|
30
30
|
let deviceData = null;
|
package/src/melclouderv.js
CHANGED
|
@@ -4,7 +4,7 @@ import Functions from './functions.js';
|
|
|
4
4
|
import { ApiUrls, ApiUrlsHome, Ventilation } from './constants.js';
|
|
5
5
|
|
|
6
6
|
class MelCloudErv extends EventEmitter {
|
|
7
|
-
constructor(account, device, defaultTempsFile, accountFile, melcloud
|
|
7
|
+
constructor(account, device, defaultTempsFile, accountFile, melcloud) {
|
|
8
8
|
super();
|
|
9
9
|
this.accountType = account.type;
|
|
10
10
|
this.logSuccess = account.log?.success;
|
|
@@ -24,7 +24,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
24
24
|
|
|
25
25
|
//set default values
|
|
26
26
|
this.deviceData = {};
|
|
27
|
-
this.headers =
|
|
27
|
+
this.headers = melcloud.headers;
|
|
28
28
|
|
|
29
29
|
//handle melcloud events
|
|
30
30
|
let deviceData = null;
|
package/src/melcloudhome.js
CHANGED
|
@@ -202,8 +202,11 @@ class MelCloudHome extends EventEmitter {
|
|
|
202
202
|
// Get scenes
|
|
203
203
|
let scenes = [];
|
|
204
204
|
try {
|
|
205
|
-
|
|
206
|
-
if (this.logDebug) this.emit('debug', `Found ${
|
|
205
|
+
const scenesList = await this.checkScenesList();
|
|
206
|
+
if (this.logDebug) this.emit('debug', `Found ${scenesList.length} scenes`);
|
|
207
|
+
if (scenesList.length > 0) {
|
|
208
|
+
scenes = scenesList;
|
|
209
|
+
}
|
|
207
210
|
} catch (error) {
|
|
208
211
|
if (this.logError) this.emit('error', `Get scenes error: ${error}`);
|
|
209
212
|
}
|
|
@@ -270,7 +273,7 @@ class MelCloudHome extends EventEmitter {
|
|
|
270
273
|
|
|
271
274
|
let browser;
|
|
272
275
|
try {
|
|
273
|
-
const accountInfo = { State: false, Info: '', Account: {}, UseFahrenheit: false
|
|
276
|
+
const accountInfo = { State: false, Info: '', Account: {}, UseFahrenheit: false };
|
|
274
277
|
let chromiumPath = await this.functions.ensureChromiumInstalled();
|
|
275
278
|
|
|
276
279
|
// === Fallback to Puppeteer's built-in Chromium ===
|
|
@@ -431,7 +434,6 @@ class MelCloudHome extends EventEmitter {
|
|
|
431
434
|
|
|
432
435
|
accountInfo.State = true;
|
|
433
436
|
accountInfo.Info = 'Connect Success';
|
|
434
|
-
accountInfo.Headers = headers;
|
|
435
437
|
await this.functions.saveData(this.accountFile, accountInfo);
|
|
436
438
|
|
|
437
439
|
return accountInfo;
|