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