homebridge-melcloud-control 4.5.6-beta.1 → 4.5.6-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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/functions.js +15 -23
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.5.6-beta.1",
4
+ "version": "4.5.6-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",
package/src/functions.js CHANGED
@@ -81,9 +81,7 @@ class Functions extends EventEmitter {
81
81
 
82
82
  try {
83
83
  const { stdout } = await execPromise('cat /proc/1/cgroup');
84
- if (stdout.includes('docker') || stdout.includes('containerd')) {
85
- isDocker = true;
86
- }
84
+ if (stdout.includes('docker') || stdout.includes('containerd')) isDocker = true;
87
85
  } catch { }
88
86
 
89
87
  /* ===================== macOS ===================== */
@@ -128,31 +126,24 @@ class Functions extends EventEmitter {
128
126
  return { path: null, arch, system: 'Qnap' };
129
127
  }
130
128
 
131
- /* ===================== Linux ARM ===================== */
132
- if (isLinux && isARM) {
133
- const armCandidates = ['/usr/bin/chromium-browser', '/usr/bin/chromium'];
134
- for (const path of armCandidates) {
129
+ /* ===================== Linux ===================== */
130
+ if (isLinux) {
131
+ const linuxCandidates = ['/usr/bin/google-chrome', '/usr/bin/chromium-browser', '/usr/bin/chromium'];
132
+
133
+ // Detect existing browser (ARM + x64)
134
+ for (const path of linuxCandidates) {
135
135
  try {
136
136
  await access(path, fs.constants.X_OK);
137
- return { path, arch, system: 'Linux ARM' };
137
+ return { path, arch, system: isDocker ? 'Linux Docker' : (isARM ? 'Linux ARM' : 'Linux') };
138
138
  } catch { }
139
139
  }
140
140
 
141
- // ARM: detect only, no runtime install
142
- return { path: null, arch, system: 'Linux ARM' };
143
- }
144
-
145
- /* ===================== Linux x64 ===================== */
146
- if (isLinux && !isARM) {
147
- const linuxCandidates = ['/usr/bin/google-chrome', '/usr/bin/chromium-browser', '/usr/bin/chromium'];
148
-
149
- try {
150
- const { stdout } = await execPromise('command -v google-chrome || command -v chromium-browser || command -v chromium');
151
- if (stdout.trim()) {
152
- return { path: stdout.trim(), arch, system: isDocker ? 'Linux Docker' : 'Linux' };
153
- }
154
- } catch { }
141
+ // ARM detect only
142
+ if (isARM) {
143
+ return { path: null, arch, system: 'Linux ARM' };
144
+ }
155
145
 
146
+ /* ===================== Linux x64 ===================== */
156
147
  if (isDocker) {
157
148
  try {
158
149
  await execPromise(`
@@ -166,6 +157,7 @@ class Functions extends EventEmitter {
166
157
  `);
167
158
  } catch (error) {
168
159
  if (this.logError) this.emit('error', `Chrome install error: ${error}`);
160
+ return { path: null, arch, system: 'Linux Docker' };
169
161
  }
170
162
 
171
163
  for (const path of linuxCandidates) {
@@ -176,7 +168,7 @@ class Functions extends EventEmitter {
176
168
  }
177
169
  }
178
170
 
179
- return { path: null, arch, system: 'Linux' };
171
+ return { path: null, arch, system: isDocker ? 'Linux Docker' : 'Linux' };
180
172
  }
181
173
 
182
174
  return { path: null, arch, system: 'unknown' };