Ensure platform only integrations are displayed on the config info page (#8698)

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
J. Nick Koston 2021-03-25 08:15:40 -10:00 committed by GitHub
parent 10baa34c18
commit ee38c419de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -25,8 +25,11 @@ export const integrationIssuesUrl = (
manifest.issue_tracker ||
`https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+${domain}%22`;
export const domainToName = (localize: LocalizeFunc, domain: string) =>
localize(`component.${domain}.title`) || domain;
export const domainToName = (
localize: LocalizeFunc,
domain: string,
manifest?: IntegrationManifest
) => localize(`component.${domain}.title`) || manifest?.name || domain;
export const fetchIntegrationManifests = (hass: HomeAssistant) =>
hass.callWS<IntegrationManifest[]>({ type: "manifest/list" });

View File

@ -28,7 +28,12 @@ class IntegrationsCard extends LitElement {
};
private _sortedIntegrations = memoizeOne((components: string[]) => {
return components.filter((comp) => !comp.includes(".")).sort();
return Array.from(
new Set(
components
.map((comp) => (comp.includes(".") ? comp.split(".")[1] : comp))
)
).sort();
});
firstUpdated(changedProps) {
@ -56,7 +61,7 @@ class IntegrationsCard extends LitElement {
/>
</td>
<td class="name">
${domainToName(this.hass.localize, domain)}<br />
${domainToName(this.hass.localize, domain, manifest)}<br />
<span class="domain">${domain}</span>
</td>
${!manifest