homebridge-melcloud-control 4.1.2-beta.61 → 4.1.2-beta.62
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/functions.js +27 -10
- package/src/melcloud.js +2 -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.1.2-beta.
|
|
4
|
+
"version": "4.1.2-beta.62",
|
|
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/functions.js
CHANGED
|
@@ -70,25 +70,40 @@ class Functions extends EventEmitter {
|
|
|
70
70
|
|
|
71
71
|
// --- Detect Docker ---
|
|
72
72
|
let isDocker = false;
|
|
73
|
-
try {
|
|
73
|
+
try {
|
|
74
|
+
await access('/.dockerenv', fs.constants.F_OK); isDocker = true;
|
|
75
|
+
} catch { }
|
|
76
|
+
|
|
74
77
|
try {
|
|
75
78
|
const { stdout } = await execPromise('cat /proc/1/cgroup || true');
|
|
76
79
|
if (stdout.includes('docker') || stdout.includes('containerd')) isDocker = true;
|
|
77
80
|
} catch { }
|
|
81
|
+
|
|
78
82
|
if (isDocker && this.logDebug) this.emit('debug', 'Running inside Docker container.');
|
|
79
83
|
|
|
80
84
|
// === macOS ===
|
|
81
85
|
if (osName === 'Darwin') {
|
|
82
86
|
chromiumPath = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
|
|
83
|
-
try {
|
|
87
|
+
try {
|
|
88
|
+
await access(chromiumPath, fs.constants.X_OK);
|
|
89
|
+
return chromiumPath;
|
|
90
|
+
} catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
84
93
|
}
|
|
85
94
|
|
|
86
95
|
// === ARM ===
|
|
87
96
|
if (arch.startsWith('arm')) {
|
|
88
|
-
try {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
try {
|
|
98
|
+
await access('/usr/bin/chromium-browser', fs.constants.X_OK);
|
|
99
|
+
return '/usr/bin/chromium-browser';
|
|
100
|
+
} catch {
|
|
101
|
+
try {
|
|
102
|
+
await execPromise('sudo apt-get update -y && sudo apt-get install -y chromium-browser chromium-codecs-ffmpeg');
|
|
103
|
+
return '/usr/bin/chromium-browser';
|
|
104
|
+
} catch {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
92
107
|
}
|
|
93
108
|
}
|
|
94
109
|
|
|
@@ -102,7 +117,9 @@ class Functions extends EventEmitter {
|
|
|
102
117
|
|
|
103
118
|
// --- Detect Entware (QNAP) ---
|
|
104
119
|
let entwareExists = false;
|
|
105
|
-
try {
|
|
120
|
+
try {
|
|
121
|
+
await access('/opt/bin/opkg', fs.constants.X_OK); entwareExists = true;
|
|
122
|
+
} catch { }
|
|
106
123
|
|
|
107
124
|
if (entwareExists) {
|
|
108
125
|
try {
|
|
@@ -119,16 +136,16 @@ class Functions extends EventEmitter {
|
|
|
119
136
|
'yum install -y nspr nss libX11 libXcomposite libXdamage libXrandr atk cups libdrm libgbm alsa-lib'
|
|
120
137
|
];
|
|
121
138
|
for (const cmd of depInstall) {
|
|
122
|
-
try {
|
|
139
|
+
try {
|
|
140
|
+
await execPromise(`sudo ${cmd}`);
|
|
141
|
+
} catch { }
|
|
123
142
|
}
|
|
124
143
|
|
|
125
144
|
// Set LD_LIBRARY_PATH so Puppeteer's Chromium can find libs
|
|
126
145
|
process.env.LD_LIBRARY_PATH = '/usr/lib:/usr/lib64:' + (process.env.LD_LIBRARY_PATH || '');
|
|
127
|
-
|
|
128
146
|
return systemChromium;
|
|
129
147
|
}
|
|
130
148
|
|
|
131
|
-
|
|
132
149
|
if (this.logDebug) this.emit('debug', `Unsupported OS: ${osName}.`);
|
|
133
150
|
return null;
|
|
134
151
|
} catch (error) {
|
package/src/melcloud.js
CHANGED
|
@@ -348,6 +348,8 @@ class MelCloud extends EventEmitter {
|
|
|
348
348
|
if (this.logDebug) this.emit('debug', `Using bundled Chromium from Puppeteer at ${chromiumPath}`);
|
|
349
349
|
}
|
|
350
350
|
} catch { }
|
|
351
|
+
} else {
|
|
352
|
+
if (this.logDebug) this.emit('debug', `Using system Chromium at ${chromiumPath}`);
|
|
351
353
|
}
|
|
352
354
|
|
|
353
355
|
if (!chromiumPath) {
|