homebridge-melcloud-control 4.0.0-beta.435 → 4.0.0-beta.436

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 +9 -10
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.435",
4
+ "version": "4.0.0-beta.436",
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
@@ -47,7 +47,6 @@ class Functions {
47
47
  }
48
48
  }
49
49
 
50
-
51
50
  async ensureChromiumInstalled() {
52
51
  let chromiumPath = '/usr/bin/chromium-browser';
53
52
 
@@ -59,7 +58,7 @@ class Functions {
59
58
  exec('uname -m', (e, out) => e ? rej(e) : res({ stdout: out }))
60
59
  );
61
60
  arch = stdout.trim();
62
- if (this.logDebug) this.emit('debug', `Detected architecture: ${arch}`);
61
+ console.log('debug', `Detected architecture: ${arch}`);
63
62
  } catch (err) {
64
63
  if (this.logWarn) this.emit('warn', `Failed to detect architecture: ${err.message}`);
65
64
  }
@@ -71,16 +70,16 @@ class Functions {
71
70
  exec('uname -s', (e, out) => e ? rej(e) : res({ stdout: out }))
72
71
  );
73
72
  osName = stdout.trim();
74
- if (this.logDebug) this.emit('debug', `Detected OS: ${osName}`);
73
+ console.log('debug', `Detected OS: ${osName}`);
75
74
  } catch (err) {
76
75
  if (this.logWarn) this.emit('warn', `Failed to detect OS: ${err.message}`);
77
76
  }
78
77
 
79
78
  // --- macOS fallback ---
80
79
  if (osName === 'Darwin') {
81
- if (this.logDebug) this.emit('debug', 'Running on macOS — using Puppeteer bundled Chromium');
80
+ console.log('debug', 'Running on macOS — using Puppeteer bundled Chromium');
82
81
  chromiumPath = puppeteer.executablePath();
83
- if (this.logDebug) this.emit('debug', `Chromium path: ${chromiumPath}`);
82
+ console.log('debug', `Chromium path: ${chromiumPath}`);
84
83
  return chromiumPath;
85
84
  }
86
85
 
@@ -94,7 +93,7 @@ class Functions {
94
93
  } catch {
95
94
  if (this.logWarn) this.emit('warn', '/etc/os-release not found, skipping OS detection.');
96
95
  }
97
- if (this.logDebug) this.emit('debug', `Linux distro: ${linuxDistro}`);
96
+ console.log('debug', `Linux distro: ${linuxDistro}`);
98
97
 
99
98
  // --- Check if Chromium exists ---
100
99
  let chromiumCheck = '';
@@ -106,7 +105,7 @@ class Functions {
106
105
  } catch { }
107
106
  if (chromiumCheck) {
108
107
  chromiumPath = chromiumCheck;
109
- if (this.logDebug) this.emit('debug', `Found system Chromium: ${chromiumPath}`);
108
+ console.log('debug', `Found system Chromium: ${chromiumPath}`);
110
109
  return chromiumPath;
111
110
  }
112
111
 
@@ -118,7 +117,7 @@ class Functions {
118
117
  exec('sudo apt-get update -y && sudo apt-get install -y chromium-browser chromium-codecs-ffmpeg', e => e ? rej(e) : res())
119
118
  );
120
119
  chromiumPath = '/usr/bin/chromium-browser';
121
- if (this.logDebug) this.emit('debug', 'Chromium installed successfully via apt-get.');
120
+ console.log('debug', 'Chromium installed successfully via apt-get.');
122
121
  return chromiumPath;
123
122
  } catch {
124
123
  if (this.logWarn) this.emit('warn', 'apt-get install failed. Trying apk or yum...');
@@ -130,7 +129,7 @@ class Functions {
130
129
  exec('sudo apk add --no-cache chromium ffmpeg', e => e ? rej(e) : res())
131
130
  );
132
131
  chromiumPath = '/usr/bin/chromium-browser';
133
- if (this.logDebug) this.emit('debug', 'Chromium installed successfully via apk.');
132
+ console.log('debug', 'Chromium installed successfully via apk.');
134
133
  return chromiumPath;
135
134
  } catch {
136
135
  if (this.logWarn) this.emit('warn', 'apk install failed. Trying yum...');
@@ -142,7 +141,7 @@ class Functions {
142
141
  exec('sudo yum install -y chromium chromium-codecs-ffmpeg', e => e ? rej(e) : res())
143
142
  );
144
143
  chromiumPath = '/usr/bin/chromium-browser';
145
- if (this.logDebug) this.emit('debug', 'Chromium installed successfully via yum.');
144
+ console.log('debug', 'Chromium installed successfully via yum.');
146
145
  return chromiumPath;
147
146
  } catch {
148
147
  if (this.logWarn) this.emit('warn', 'yum install failed. Falling back to Puppeteer bundled Chromium.');