Add icon to add-on picker (#12174)

This commit is contained in:
Joakim Sørensen 2022-03-31 15:16:19 +02:00 committed by GitHub
parent bf35ee549d
commit edc15940a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,7 @@ export const mockHassioSupervisor = (hass: MockHomeAssistant) => {
version_latest: "3.6.2", version_latest: "3.6.2",
update_available: false, update_available: false,
repository: "a0d7b954", repository: "a0d7b954",
icon: true, icon: false,
logo: true, logo: true,
}, },
{ {

Binary file not shown.

View File

@ -13,9 +13,12 @@ import { HaComboBox } from "./ha-combo-box";
const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = ( const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = (
item item
) => html`<mwc-list-item twoline> ) => html`<mwc-list-item twoline graphic="icon">
<span>${item.name}</span> <span>${item.name}</span>
<span slot="secondary">${item.slug}</span> <span slot="secondary">${item.slug}</span>
${item.icon
? html`<img slot="graphic" .src="/api/hassio/addons/${item.slug}/icon" />`
: ""}
</mwc-list-item>`; </mwc-list-item>`;
@customElement("ha-addon-picker") @customElement("ha-addon-picker")