hass-taste-test 0.2.5 → 0.2.6
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/lib/index.d.ts +1 -0
- package/lib/index.js +7 -3
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -57,6 +57,7 @@ class HomeAssistant {
|
|
|
57
57
|
options;
|
|
58
58
|
dashboards = 0;
|
|
59
59
|
entities = {};
|
|
60
|
+
started = false;
|
|
60
61
|
ws;
|
|
61
62
|
constructor(options) {
|
|
62
63
|
this.venvDir = (0, path_1.join)((0, os_1.tmpdir)(), 'hasstest-venv');
|
|
@@ -109,8 +110,11 @@ class HomeAssistant {
|
|
|
109
110
|
await fs.writeFile(this.path_cache(), JSON.stringify(this.cache));
|
|
110
111
|
await releaseLock();
|
|
111
112
|
// Step 3: Start Home Assistant and onboard
|
|
112
|
-
this.process = (0, child_process_1.spawn)(this.path_hass(), ['-c', this.configDir, '-v', ...this.options.hassArgs], {
|
|
113
|
-
|
|
113
|
+
this.process = (0, child_process_1.spawn)(this.path_hass(), ['-c', this.configDir, '-v', ...this.options.hassArgs], { stdio: 'pipe' });
|
|
114
|
+
this.process.stderr.on('data', (d) => {
|
|
115
|
+
if (d.includes('Starting Home Assistant'))
|
|
116
|
+
this.started = true;
|
|
117
|
+
process.stderr.write(d);
|
|
114
118
|
});
|
|
115
119
|
this.process.on('error', (e) => {
|
|
116
120
|
console.error(`----\nHome Assistant is having trouble starting. This is likely due to a problem with your virtual environment; try removing the venv folder at ${this.venvDir} and re-running hass-taste-test\n---`);
|
|
@@ -122,7 +126,7 @@ class HomeAssistant {
|
|
|
122
126
|
if (code != 0)
|
|
123
127
|
reject(new Error(`Home Assistant exited with code ${code}`));
|
|
124
128
|
});
|
|
125
|
-
while (!(await this.isUp()))
|
|
129
|
+
while (!this.started || !(await this.isUp()))
|
|
126
130
|
await sleep();
|
|
127
131
|
resolve();
|
|
128
132
|
});
|