mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 12:26:35 +00:00
Add support for brand images (#13930)
This commit is contained in:
parent
cd8c1f42ca
commit
b9395e1c97
@ -385,7 +385,11 @@ class AddIntegrationDialog extends LitElement {
|
||||
return html``;
|
||||
}
|
||||
return html`
|
||||
<ha-integration-list-item .hass=${this.hass} .integration=${integration}>
|
||||
<ha-integration-list-item
|
||||
brand
|
||||
.hass=${this.hass}
|
||||
.integration=${integration}
|
||||
>
|
||||
</ha-integration-list-item>
|
||||
`;
|
||||
};
|
||||
|
@ -22,6 +22,8 @@ export class HaIntegrationListItem extends ListItemBase {
|
||||
|
||||
@property({ type: Boolean }) hasMeta = true;
|
||||
|
||||
@property({ type: Boolean }) brand = false;
|
||||
|
||||
renderSingleLine() {
|
||||
if (!this.integration) {
|
||||
return html``;
|
||||
@ -51,6 +53,7 @@ export class HaIntegrationListItem extends ListItemBase {
|
||||
type: "icon",
|
||||
useFallback: true,
|
||||
darkOptimized: this.hass.themes?.darkMode,
|
||||
brand: this.brand,
|
||||
})}
|
||||
referrerpolicy="no-referrer"
|
||||
/>
|
||||
|
@ -3,6 +3,7 @@ export interface BrandsOptions {
|
||||
type: "icon" | "logo" | "icon@2x" | "logo@2x";
|
||||
useFallback?: boolean;
|
||||
darkOptimized?: boolean;
|
||||
brand?: boolean;
|
||||
}
|
||||
|
||||
export interface HardwareBrandsOptions {
|
||||
@ -13,9 +14,11 @@ export interface HardwareBrandsOptions {
|
||||
}
|
||||
|
||||
export const brandsUrl = (options: BrandsOptions): string =>
|
||||
`https://brands.home-assistant.io/${options.useFallback ? "_/" : ""}${
|
||||
options.domain
|
||||
}/${options.darkOptimized ? "dark_" : ""}${options.type}.png`;
|
||||
`https://brands.home-assistant.io/${options.brand ? "brands/" : ""}${
|
||||
options.useFallback ? "_/" : ""
|
||||
}${options.domain}/${options.darkOptimized ? "dark_" : ""}${
|
||||
options.type
|
||||
}.png`;
|
||||
|
||||
export const hardwareBrandsUrl = (options: HardwareBrandsOptions): string =>
|
||||
`https://brands.home-assistant.io/hardware/${options.category}/${
|
||||
|
Loading…
x
Reference in New Issue
Block a user