diff --git a/gallery/src/pages/components/ha-alert.ts b/gallery/src/pages/components/ha-alert.ts index ced4c5a44b..a0d3f309fb 100644 --- a/gallery/src/pages/components/ha-alert.ts +++ b/gallery/src/pages/components/ha-alert.ts @@ -98,7 +98,9 @@ const alerts: { description: "Alert with slotted image", type: "warning", iconSlot: html`Home Assistant logo`, }, { diff --git a/hassio/src/addon-view/info/hassio-addon-info.ts b/hassio/src/addon-view/info/hassio-addon-info.ts index 3cc3d23010..a6e8c99217 100644 --- a/hassio/src/addon-view/info/hassio-addon-info.ts +++ b/hassio/src/addon-view/info/hassio-addon-info.ts @@ -404,6 +404,7 @@ class HassioAddonInfo extends LitElement { ? html` ` diff --git a/src/components/ha-addon-picker.ts b/src/components/ha-addon-picker.ts index 955bb6fefb..8c765d9755 100644 --- a/src/components/ha-addon-picker.ts +++ b/src/components/ha-addon-picker.ts @@ -16,7 +16,11 @@ const rowRenderer: ComboBoxLitRenderer = ( ${item.name} ${item.slug} ${item.icon - ? html`` + ? html`` : ""} `; diff --git a/src/components/ha-config-entry-picker.ts b/src/components/ha-config-entry-picker.ts index 7bd4301bfe..09bfc45b4e 100644 --- a/src/components/ha-config-entry-picker.ts +++ b/src/components/ha-config-entry-picker.ts @@ -59,6 +59,7 @@ class HaConfigEntryPicker extends LitElement { > ${item.localized_domain_name} - ${this.imageUrl ? html`` : null} + ${this.imageUrl + ? html`${ifDefined(this.imageAlt)}` + : null} `; } diff --git a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts index 74e3711235..94b6d22065 100644 --- a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts +++ b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts @@ -74,7 +74,7 @@ export class HaImagecropperDialog extends LitElement { round: Boolean(this._params?.options.round), })}" > - + ${this.hass.localize("ui.dialogs.image_cropper.crop_image")} ${this.hass.localize("ui.common.cancel")} diff --git a/src/onboarding/integration-badge.ts b/src/onboarding/integration-badge.ts index 62e48d1b00..fc440b1589 100644 --- a/src/onboarding/integration-badge.ts +++ b/src/onboarding/integration-badge.ts @@ -19,6 +19,7 @@ class IntegrationBadge extends LitElement { return html`
${area.picture ? html`
- + ${imageURL - ? html`` + ? html`` : ""} ${boardName || diff --git a/src/panels/config/integrations/ha-domain-integrations.ts b/src/panels/config/integrations/ha-domain-integrations.ts index 32a281247f..f62461b553 100644 --- a/src/panels/config/integrations/ha-domain-integrations.ts +++ b/src/panels/config/integrations/ha-domain-integrations.ts @@ -48,6 +48,7 @@ class HaDomainIntegrations extends LitElement { hasMeta >
${domainToName(this.hass.localize, `; + this._qrCode = html`${this.hass.localize(`; } static get styles(): CSSResultGroup { diff --git a/src/panels/lovelace/cards/hui-picture-card.ts b/src/panels/lovelace/cards/hui-picture-card.ts index 20a2a2f315..ffcf4f5009 100644 --- a/src/panels/lovelace/cards/hui-picture-card.ts +++ b/src/panels/lovelace/cards/hui-picture-card.ts @@ -101,7 +101,10 @@ export class HuiPictureCard extends LitElement implements LovelaceCard { ), })} > - + ${this._config.alt_text} `; } diff --git a/src/panels/lovelace/cards/types.ts b/src/panels/lovelace/cards/types.ts index 5ab627b466..2ad69eeb94 100644 --- a/src/panels/lovelace/cards/types.ts +++ b/src/panels/lovelace/cards/types.ts @@ -332,6 +332,7 @@ export interface PictureCardConfig extends LovelaceCardConfig { hold_action?: ActionConfig; double_tap_action?: ActionConfig; theme?: string; + alt_text?: string; } export interface PictureElementsCardConfig extends LovelaceCardConfig { diff --git a/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts index 8174a049e2..ee75869fc6 100644 --- a/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-picture-card-editor.ts @@ -20,6 +20,7 @@ const cardConfigStruct = assign( tap_action: optional(actionConfigStruct), hold_action: optional(actionConfigStruct), theme: optional(string()), + alt_text: optional(string()), }) ); @@ -53,6 +54,10 @@ export class HuiPictureCardEditor return this._config!.theme || ""; } + get _alt_text(): string { + return this._config!.alt_text || ""; + } + protected render(): TemplateResult { if (!this.hass || !this._config) { return html``; @@ -72,6 +77,16 @@ export class HuiPictureCardEditor .configValue=${"image"} @input=${this._valueChanged} > + `; + this._qrCode = html`${this.hass.localize(`; } static get styles(): CSSResultGroup { diff --git a/src/translations/en.json b/src/translations/en.json index a6329fb139..f0b5e00104 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -791,7 +791,8 @@ "close": "Close" }, "image_cropper": { - "crop": "Crop" + "crop": "Crop", + "crop_image": "Picture to crop" }, "date-picker": { "today": "Today" @@ -1435,6 +1436,7 @@ "confirm_remove_title": "Remove tag?", "confirm_remove": "Are you sure you want to remove tag {tag}?", "automation_title": "Tag {name} is scanned", + "qr_code_image": "QR code for tag {name}", "headers": { "icon": "Icon", "name": "Name", @@ -4195,6 +4197,7 @@ "description": "The Light card allows you to change the brightness of the light." }, "generic": { + "alt_text": "Alternative Text", "aspect_ratio": "Aspect Ratio", "attribute": "Attribute", "camera_image": "Camera Entity", @@ -4598,7 +4601,8 @@ "name": "Name", "prompt_name": "Give the token a name", "prompt_copy_token": "Copy your access token. It will not be shown again.", - "empty_state": "You have no long-lived access tokens yet." + "empty_state": "You have no long-lived access tokens yet.", + "qr_code_image": "QR code for token {name}" } }, "shopping_list": {