homebridge-melcloud-control 4.3.16-beta.0 → 4.3.16-beta.2
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 +2 -2
- package/src/functions.js +7 -7
- package/src/melcloudhome.js +5 -6
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.16-beta.
|
|
4
|
+
"version": "4.3.16-beta.2",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"async-mqtt": "^2.6.3",
|
|
40
40
|
"axios": "^1.13.2",
|
|
41
41
|
"express": "^5.2.1",
|
|
42
|
-
"puppeteer": "^24.32.
|
|
42
|
+
"puppeteer": "^24.32.1",
|
|
43
43
|
"ws": "^8.18.3"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
package/src/functions.js
CHANGED
|
@@ -56,7 +56,7 @@ class Functions extends EventEmitter {
|
|
|
56
56
|
|
|
57
57
|
async ensureChromiumInstalled() {
|
|
58
58
|
try {
|
|
59
|
-
//
|
|
59
|
+
// Detect OS
|
|
60
60
|
const { stdout: osOut } = await execPromise("uname -s");
|
|
61
61
|
const osName = osOut.trim();
|
|
62
62
|
const { stdout: archOut } = await execPromise("uname -m");
|
|
@@ -66,7 +66,7 @@ class Functions extends EventEmitter {
|
|
|
66
66
|
const isMac = osName === "Darwin";
|
|
67
67
|
const isLinux = osName === "Linux";
|
|
68
68
|
|
|
69
|
-
//
|
|
69
|
+
// Detect Docker
|
|
70
70
|
let isDocker = false;
|
|
71
71
|
try {
|
|
72
72
|
await access("/.dockerenv");
|
|
@@ -77,7 +77,7 @@ class Functions extends EventEmitter {
|
|
|
77
77
|
if (stdout.includes("docker") || stdout.includes("containerd")) isDocker = true;
|
|
78
78
|
} catch { }
|
|
79
79
|
|
|
80
|
-
//
|
|
80
|
+
// macOS
|
|
81
81
|
if (isMac) {
|
|
82
82
|
const macCandidates = [
|
|
83
83
|
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
|
|
@@ -92,7 +92,7 @@ class Functions extends EventEmitter {
|
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
//
|
|
95
|
+
// ARM / Raspberry Pi
|
|
96
96
|
if (isARM && isLinux) {
|
|
97
97
|
const armCandidates = [
|
|
98
98
|
"/usr/bin/chromium-browser",
|
|
@@ -132,7 +132,7 @@ class Functions extends EventEmitter {
|
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
//
|
|
135
|
+
// QNAP / Entware
|
|
136
136
|
let entwareExists = false;
|
|
137
137
|
try {
|
|
138
138
|
await access("/opt/bin/opkg", fs.constants.X_OK);
|
|
@@ -147,7 +147,7 @@ class Functions extends EventEmitter {
|
|
|
147
147
|
} catch { }
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
//
|
|
150
|
+
// Synology DSM 7
|
|
151
151
|
const synoCandidates = [
|
|
152
152
|
"/var/packages/Chromium/target/usr/bin/chromium",
|
|
153
153
|
"/usr/local/chromium/bin/chromium"
|
|
@@ -159,7 +159,7 @@ class Functions extends EventEmitter {
|
|
|
159
159
|
} catch { }
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
//
|
|
162
|
+
// Linux x64
|
|
163
163
|
if (isLinux) {
|
|
164
164
|
const linuxCandidates = [
|
|
165
165
|
"/usr/bin/chromium",
|
package/src/melcloudhome.js
CHANGED
|
@@ -228,7 +228,7 @@ class MelCloudHome extends EventEmitter {
|
|
|
228
228
|
// Get Chromium path
|
|
229
229
|
let chromiumPath = await this.functions.ensureChromiumInstalled();
|
|
230
230
|
|
|
231
|
-
//
|
|
231
|
+
// Fallback to Puppeteer's bundled Chromium
|
|
232
232
|
if (!chromiumPath) {
|
|
233
233
|
try {
|
|
234
234
|
const puppeteerPath = puppeteer.executablePath();
|
|
@@ -245,7 +245,7 @@ class MelCloudHome extends EventEmitter {
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
//
|
|
248
|
+
// Verify Chromium executable
|
|
249
249
|
try {
|
|
250
250
|
const { stdout } = await execPromise(`"${chromiumPath}" --version`);
|
|
251
251
|
if (this.logDebug) this.emit('debug', `Chromium detected: ${stdout.trim()}`);
|
|
@@ -277,7 +277,7 @@ class MelCloudHome extends EventEmitter {
|
|
|
277
277
|
page.setDefaultTimeout(GLOBAL_TIMEOUT);
|
|
278
278
|
page.setDefaultNavigationTimeout(GLOBAL_TIMEOUT);
|
|
279
279
|
|
|
280
|
-
//
|
|
280
|
+
// CDP session
|
|
281
281
|
const client = await page.createCDPSession();
|
|
282
282
|
await client.send('Network.enable')
|
|
283
283
|
client.on('Network.webSocketCreated', ({ url }) => {
|
|
@@ -311,7 +311,7 @@ class MelCloudHome extends EventEmitter {
|
|
|
311
311
|
.on('open', () => {
|
|
312
312
|
this.socketConnected = true;
|
|
313
313
|
this.connecting = false;
|
|
314
|
-
if (this.logDebug) this.emit('debug', `Web Socket
|
|
314
|
+
if (this.logDebug) this.emit('debug', `Web Socket Connected`);
|
|
315
315
|
|
|
316
316
|
// heartbeat
|
|
317
317
|
this.heartbeat = setInterval(() => {
|
|
@@ -400,7 +400,6 @@ class MelCloudHome extends EventEmitter {
|
|
|
400
400
|
`__Secure-monitorandcontrolC2=${c2}`
|
|
401
401
|
].join('; ');
|
|
402
402
|
|
|
403
|
-
|
|
404
403
|
const userAgent = await page.evaluate(() => navigator.userAgent);
|
|
405
404
|
const headers = {
|
|
406
405
|
'Accept': '*/*',
|
|
@@ -424,7 +423,7 @@ class MelCloudHome extends EventEmitter {
|
|
|
424
423
|
this.emit('client', this.client);
|
|
425
424
|
|
|
426
425
|
accountInfo.State = true;
|
|
427
|
-
accountInfo.Info = `Connect Success
|
|
426
|
+
accountInfo.Info = `Connect Success${this.socketConnected ? ', Web Socket Connected' : ''}`;
|
|
428
427
|
await this.functions.saveData(this.accountFile, accountInfo);
|
|
429
428
|
|
|
430
429
|
return accountInfo;
|