Skip to content

Commit

Permalink
Add support for returning multiple config from a single call to expos…
Browse files Browse the repository at this point in the history
…eToConfig.
  • Loading branch information
ruifung committed Jul 8, 2021
1 parent 4d415bc commit a422932
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/extension/homeassistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,11 @@ class HomeAssistant extends Extension {
for (const expose of def.exposes) {
const discoveryEntry = this.exposeToConfig([expose], 'device', def);
if (discoveryEntry) {
this.mapping[def.model].push(discoveryEntry);
if (Array.isArray(discoveryEntry)) {
this.mapping[def.model].push(...discoveryEntry);
} else {
this.mapping[def.model].push(discoveryEntry);
}
}
}
}
Expand Down

0 comments on commit a422932

Please sign in to comment.