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 CHANGED
@@ -26,6 +26,7 @@ export declare class HomeAssistant<E> {
26
26
  private options;
27
27
  private dashboards;
28
28
  private entities;
29
+ private started;
29
30
  ws: hass.Connection;
30
31
  private constructor();
31
32
  private path_confFile;
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
- stdio: 'inherit',
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hass-taste-test",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Integration testing for Home Assistant cards",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {