Show number config entries when no devices/entities (#16766)

This commit is contained in:
Bram Kragten 2023-06-05 14:17:03 +02:00 committed by GitHub
parent ddaf403378
commit 6c684fd8ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import {
mdiCogOutline,
mdiDevices,
mdiHandExtendedOutline,
mdiPuzzleOutline,
mdiShapeOutline,
} from "@mdi/js";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
@ -140,6 +141,22 @@ export class HaIntegrationCard extends LitElement {
</ha-list-item>
</a>`
: ""}
${devices.length === 0 && entities.length === 0
? html`<a href=${`/config/integrations/integration/${this.domain}`}>
<ha-list-item hasMeta graphic="icon">
<ha-svg-icon
.path=${mdiPuzzleOutline}
slot="graphic"
></ha-svg-icon>
${this.hass.localize(
`ui.panel.config.integrations.config_entry.entries`,
"count",
this.items.length
)}
<ha-icon-next slot="meta"></ha-icon-next>
</ha-list-item>
</a>`
: ""}
</div>
`;
}

View File

@ -3266,6 +3266,7 @@
"devices": "{count} {count, plural,\n one {device}\n other {devices}\n}",
"entities": "{count} {count, plural,\n one {entity}\n other {entities}\n}",
"services": "{count} {count, plural,\n one {service}\n other {services}\n}",
"entries": "{count} {count, plural,\n one {entry}\n other {entries}\n}",
"rename": "Rename",
"configure": "Configure",
"system_options": "System options",