From f527c8c3451917ecbc7f56a8c27f344cbc812c8f Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Thu, 17 Nov 2022 18:56:32 -0800 Subject: [PATCH 01/30] ha-config-area-page: Add alt tag for area-picture --- src/panels/config/areas/ha-config-area-page.ts | 8 +++++++- src/translations/en.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index e4e3911d2d8a..0bd06ef44ef0 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -258,7 +258,13 @@ class HaConfigAreaPage extends SubscribeMixin(LitElement) {
${area.picture ? html`
- + Date: Thu, 17 Nov 2022 18:56:58 -0800 Subject: [PATCH 02/30] dialog-tag-detail: Add alt tag for generated QR code image. --- src/panels/config/tags/dialog-tag-detail.ts | 9 ++++++++- src/translations/en.json | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/panels/config/tags/dialog-tag-detail.ts b/src/panels/config/tags/dialog-tag-detail.ts index a084f22e771b..995273a1cf09 100644 --- a/src/panels/config/tags/dialog-tag-detail.ts +++ b/src/panels/config/tags/dialog-tag-detail.ts @@ -244,7 +244,14 @@ class DialogTagDetail canvas.height / 3 ); - this._qrCode = html``; + this._qrCode = html`${this.hass.localize(`; } static get styles(): CSSResultGroup { diff --git a/src/translations/en.json b/src/translations/en.json index be0eb5110c75..e13f8a87442e 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1374,6 +1374,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 image for tag {name}", "headers": { "icon": "Icon", "name": "Name", From 017515179a6104dfb46ca8a09ebfd345ee54b3ae Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Thu, 17 Nov 2022 18:58:54 -0800 Subject: [PATCH 03/30] ha-config-hardware: Blank alt tag for hardware pic, info already elsewhere --- src/panels/config/hardware/ha-config-hardware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/config/hardware/ha-config-hardware.ts b/src/panels/config/hardware/ha-config-hardware.ts index 83f664934d88..33a82523d9d7 100644 --- a/src/panels/config/hardware/ha-config-hardware.ts +++ b/src/panels/config/hardware/ha-config-hardware.ts @@ -249,7 +249,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) { .twoline=${Boolean(boardId)} > ${imageURL - ? html`` + ? html`` : ""} ${boardName || From 096c241246912d22fe6305aec862f23775e526ac Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Thu, 17 Nov 2022 18:59:22 -0800 Subject: [PATCH 04/30] dialog-energy-solar-settings: Blank alt tag for brand icon. --- src/panels/config/energy/dialogs/dialog-energy-solar-settings.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panels/config/energy/dialogs/dialog-energy-solar-settings.ts b/src/panels/config/energy/dialogs/dialog-energy-solar-settings.ts index d6ebd03533f6..3423932916fc 100644 --- a/src/panels/config/energy/dialogs/dialog-energy-solar-settings.ts +++ b/src/panels/config/energy/dialogs/dialog-energy-solar-settings.ts @@ -130,6 +130,7 @@ export class DialogEnergySolarSettings style="display: flex; align-items: center;" > Date: Thu, 17 Nov 2022 18:59:46 -0800 Subject: [PATCH 05/30] ha-energy-grid-settings: Blank alt tag for co2signal brand icon. --- src/panels/config/energy/components/ha-energy-grid-settings.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/panels/config/energy/components/ha-energy-grid-settings.ts b/src/panels/config/energy/components/ha-energy-grid-settings.ts index c04993b0ec9f..f55c2d57b00a 100644 --- a/src/panels/config/energy/components/ha-energy-grid-settings.ts +++ b/src/panels/config/energy/components/ha-energy-grid-settings.ts @@ -220,6 +220,7 @@ export class EnergyGridSettings extends LitElement { ${this._co2ConfigEntry ? html`
Date: Thu, 17 Nov 2022 19:27:55 -0800 Subject: [PATCH 06/30] Add a few more appropriately-blank alt texts. --- src/panels/config/integrations/ha-domain-integrations.ts | 1 + src/panels/config/integrations/ha-integration-header.ts | 1 + src/panels/config/integrations/ha-integration-list-item.ts | 1 + src/panels/config/repairs/integrations-startup-time.ts | 1 + 4 files changed, 4 insertions(+) diff --git a/src/panels/config/integrations/ha-domain-integrations.ts b/src/panels/config/integrations/ha-domain-integrations.ts index 12ce88a8622f..ea420b9e37c4 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 >
Date: Thu, 17 Nov 2022 19:28:35 -0800 Subject: [PATCH 07/30] ha-config-device-page: Logo alt text set to name of device domain. --- src/panels/config/devices/ha-config-device-page.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 2e6fd4f8b48e..24d70a76f349 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -656,6 +656,7 @@ export class HaConfigDevicePage extends LitElement { integrations.length ? html` ${domainToName(this.hass.localize, Date: Thu, 17 Nov 2022 19:28:51 -0800 Subject: [PATCH 08/30] ha-config-repairs: Logo alt text set to name of issue domain. --- src/panels/config/repairs/ha-config-repairs.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panels/config/repairs/ha-config-repairs.ts b/src/panels/config/repairs/ha-config-repairs.ts index 2cadd4a9b91c..e24a5f1dfd70 100644 --- a/src/panels/config/repairs/ha-config-repairs.ts +++ b/src/panels/config/repairs/ha-config-repairs.ts @@ -52,6 +52,7 @@ class HaConfigRepairs extends LitElement { @click=${this._openShowMoreDialog} > ${domainToName(this.hass.localize, Date: Thu, 17 Nov 2022 19:36:22 -0800 Subject: [PATCH 09/30] hui-picture-card(-editor): Alternate Text via config (blank default) --- src/panels/lovelace/cards/hui-picture-card.ts | 2 +- .../config-elements/hui-picture-card-editor.ts | 15 +++++++++++++++ src/translations/en.json | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-picture-card.ts b/src/panels/lovelace/cards/hui-picture-card.ts index 20a2a2f31551..9b15c00a627b 100644 --- a/src/panels/lovelace/cards/hui-picture-card.ts +++ b/src/panels/lovelace/cards/hui-picture-card.ts @@ -101,7 +101,7 @@ export class HuiPictureCard extends LitElement implements LovelaceCard { ), })} > - + ${this._config.alt_text} `; } 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 8174a049e2f1..3e2fb2e1695d 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} > + Date: Thu, 17 Nov 2022 19:53:27 -0800 Subject: [PATCH 10/30] hui-picture-entity-card(-editor): Alternate Text via config (blank default) --- src/panels/lovelace/cards/hui-picture-entity-card.ts | 1 + src/panels/lovelace/components/hui-image.ts | 1 + .../editor/config-elements/hui-picture-entity-card-editor.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/panels/lovelace/cards/hui-picture-entity-card.ts b/src/panels/lovelace/cards/hui-picture-entity-card.ts index aaab63cb0f63..629e8a6f5c23 100644 --- a/src/panels/lovelace/cards/hui-picture-entity-card.ts +++ b/src/panels/lovelace/cards/hui-picture-entity-card.ts @@ -143,6 +143,7 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard { Date: Thu, 17 Nov 2022 20:11:55 -0800 Subject: [PATCH 11/30] ha-long-lived-access-token-dialog: Alt text for QR code. --- src/panels/profile/ha-long-lived-access-token-dialog.ts | 9 ++++++++- src/translations/en.json | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/panels/profile/ha-long-lived-access-token-dialog.ts b/src/panels/profile/ha-long-lived-access-token-dialog.ts index 5786a783a491..e7365098437d 100644 --- a/src/panels/profile/ha-long-lived-access-token-dialog.ts +++ b/src/panels/profile/ha-long-lived-access-token-dialog.ts @@ -85,7 +85,14 @@ export class HaLongLivedAccessTokenDialog extends LitElement { canvas.height / 3 ); - this._qrCode = html``; + this._qrCode = html`${this.hass.localize(`; } static get styles(): CSSResultGroup { diff --git a/src/translations/en.json b/src/translations/en.json index 835b813988c7..98eb5b1ee06f 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1374,7 +1374,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 image for tag {name}", + "qr_code_image": "QR code image for tag: {name}", "headers": { "icon": "Icon", "name": "Name", @@ -4462,7 +4462,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 image for long-lived access token: {name}" } }, "shopping_list": { From bec8b78a721b37111616b09475181f9accea5159 Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Thu, 17 Nov 2022 20:12:27 -0800 Subject: [PATCH 12/30] hui-picture-header-footer: Support alt text via optional property. --- src/panels/lovelace/editor/structs/entities-struct.ts | 1 + src/panels/lovelace/header-footer/hui-picture-header-footer.ts | 1 + src/panels/lovelace/header-footer/structs.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/panels/lovelace/editor/structs/entities-struct.ts b/src/panels/lovelace/editor/structs/entities-struct.ts index 837f621b19f8..09407689d286 100644 --- a/src/panels/lovelace/editor/structs/entities-struct.ts +++ b/src/panels/lovelace/editor/structs/entities-struct.ts @@ -14,6 +14,7 @@ export const entitiesConfigStruct = union([ tap_action: optional(actionConfigStruct), hold_action: optional(actionConfigStruct), double_tap_action: optional(actionConfigStruct), + alt_text: optional(string()), }), string(), ]); diff --git a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts index 200744f85c17..169f55d57636 100644 --- a/src/panels/lovelace/header-footer/hui-picture-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-picture-header-footer.ts @@ -68,6 +68,7 @@ export class HuiPictureHeaderFooter return html` ${this._config!.alt_text} Date: Thu, 17 Nov 2022 21:41:35 -0800 Subject: [PATCH 13/30] A few more blank alt attributes. --- gallery/src/pages/components/ha-alert.ts | 2 +- hassio/src/addon-view/info/hassio-addon-info.ts | 1 + src/components/ha-addon-picker.ts | 2 +- src/components/ha-config-entry-picker.ts | 1 + src/dialogs/image-cropper-dialog/image-cropper-dialog.ts | 2 +- src/onboarding/integration-badge.ts | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gallery/src/pages/components/ha-alert.ts b/gallery/src/pages/components/ha-alert.ts index ced4c5a44b31..29b297b43baa 100644 --- a/gallery/src/pages/components/ha-alert.ts +++ b/gallery/src/pages/components/ha-alert.ts @@ -98,7 +98,7 @@ const alerts: { description: "Alert with slotted image", type: "warning", iconSlot: html``, }, { diff --git a/hassio/src/addon-view/info/hassio-addon-info.ts b/hassio/src/addon-view/info/hassio-addon-info.ts index 3cc3d230100c..a6e8c9921705 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 cd8b7c4bf536..0a70c3fdcb60 100644 --- a/src/components/ha-addon-picker.ts +++ b/src/components/ha-addon-picker.ts @@ -16,7 +16,7 @@ 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 733598b00301..237a108f25ce 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.hass.localize("ui.common.cancel")} diff --git a/src/onboarding/integration-badge.ts b/src/onboarding/integration-badge.ts index 62e48d1b00c5..fc440b158906 100644 --- a/src/onboarding/integration-badge.ts +++ b/src/onboarding/integration-badge.ts @@ -19,6 +19,7 @@ class IntegrationBadge extends LitElement { return html`
Date: Thu, 17 Nov 2022 21:41:58 -0800 Subject: [PATCH 14/30] ha-tile-image: Support alt tag (but it is blank in current usage). --- src/components/tile/ha-tile-image.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/tile/ha-tile-image.ts b/src/components/tile/ha-tile-image.ts index 099074941270..1754ce3820b2 100644 --- a/src/components/tile/ha-tile-image.ts +++ b/src/components/tile/ha-tile-image.ts @@ -4,11 +4,12 @@ import { customElement, property } from "lit/decorators"; @customElement("ha-tile-image") export class HaTileImage extends LitElement { @property() public imageUrl?: string; + @property() public alt?: string; protected render(): TemplateResult { return html`
- ${this.imageUrl ? html`` : null} + ${this.imageUrl ? html`${this.alt}` : null}
`; } From fd622e4d4e73ce6692e19e4346fd1fe888360eae Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Thu, 17 Nov 2022 22:57:03 -0800 Subject: [PATCH 15/30] prod cla-bot From 60a7073d91a264c25581116662b2244bdbb6107b Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Fri, 18 Nov 2022 12:02:48 -0800 Subject: [PATCH 16/30] Lint. Fix whitespace. --- src/components/tile/ha-tile-image.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/tile/ha-tile-image.ts b/src/components/tile/ha-tile-image.ts index 1754ce3820b2..60043d3d57b2 100644 --- a/src/components/tile/ha-tile-image.ts +++ b/src/components/tile/ha-tile-image.ts @@ -4,6 +4,7 @@ import { customElement, property } from "lit/decorators"; @customElement("ha-tile-image") export class HaTileImage extends LitElement { @property() public imageUrl?: string; + @property() public alt?: string; protected render(): TemplateResult { From 056d32522c872a86b82229116c0c2f0a478c7c55 Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Fri, 18 Nov 2022 12:22:56 -0800 Subject: [PATCH 17/30] Add missing alt text properties to TS types. --- src/panels/lovelace/components/hui-image.ts | 2 ++ src/panels/lovelace/header-footer/types.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/panels/lovelace/components/hui-image.ts b/src/panels/lovelace/components/hui-image.ts index 7d32ffb30475..fbc8dbeb4837 100644 --- a/src/panels/lovelace/components/hui-image.ts +++ b/src/panels/lovelace/components/hui-image.ts @@ -58,6 +58,8 @@ export class HuiImage extends LitElement { @property() public darkModeFilter?: string; + @property() public altText?: string; + @state() private _imageVisible? = false; @state() private _loadState?: LoadState; diff --git a/src/panels/lovelace/header-footer/types.ts b/src/panels/lovelace/header-footer/types.ts index 45ff294723a0..424855205294 100644 --- a/src/panels/lovelace/header-footer/types.ts +++ b/src/panels/lovelace/header-footer/types.ts @@ -27,4 +27,5 @@ export interface PictureHeaderFooterConfig extends LovelaceHeaderFooterConfig { tap_action?: ActionConfig; hold_action?: ActionConfig; double_tap_action?: ActionConfig; + alt_text?: string; } From 0a01244b5151c9b0980c53850bd25cdb608d8a4b Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Fri, 18 Nov 2022 12:48:00 -0800 Subject: [PATCH 18/30] Fix my silly typo in picture-entity-card-editor's SCHEMA (+ minor reformat) --- .../editor/config-elements/hui-picture-entity-card-editor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts index 69e15c4e9f42..10f8a4c7622c 100644 --- a/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-picture-entity-card-editor.ts @@ -25,7 +25,7 @@ const cardConfigStruct = assign( show_name: optional(boolean()), show_state: optional(boolean()), theme: optional(string()), - alt_text: optional(string()) + alt_text: optional(string()), }) ); @@ -68,7 +68,7 @@ const SCHEMA = [ name: "hold_action", selector: { "ui-action": {} }, }, - { name: "alt_text", selector: { text() {} } }, + { name: "alt_text", selector: { text: {} } }, ] as const; @customElement("hui-picture-entity-card-editor") From 86c94f7f00510412902c11529311389f8f1f3119 Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Fri, 18 Nov 2022 12:48:28 -0800 Subject: [PATCH 19/30] Add alt_text to Picture(Entity)CardConfig TypeScript types. --- src/panels/lovelace/cards/types.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/panels/lovelace/cards/types.ts b/src/panels/lovelace/cards/types.ts index 75f1d2bdee1d..05012582060a 100644 --- a/src/panels/lovelace/cards/types.ts +++ b/src/panels/lovelace/cards/types.ts @@ -329,6 +329,7 @@ export interface PictureCardConfig extends LovelaceCardConfig { hold_action?: ActionConfig; double_tap_action?: ActionConfig; theme?: string; + alt_text?: string; } export interface PictureElementsCardConfig extends LovelaceCardConfig { @@ -361,6 +362,7 @@ export interface PictureEntityCardConfig extends LovelaceCardConfig { show_name?: boolean; show_state?: boolean; theme?: string; + alt_text?: string; } export interface PictureGlanceCardConfig extends LovelaceCardConfig { From b4ad698676b43f2aacb1ce8c84f994774684c487 Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Fri, 18 Nov 2022 13:51:32 -0800 Subject: [PATCH 20/30] Format with prettier. --- gallery/src/pages/components/ha-alert.ts | 4 +++- src/components/ha-addon-picker.ts | 6 +++++- src/components/tile/ha-tile-image.ts | 4 +++- src/dialogs/image-cropper-dialog/image-cropper-dialog.ts | 2 +- src/panels/config/areas/ha-config-area-page.ts | 4 ++-- src/panels/config/devices/ha-config-device-page.ts | 5 ++++- src/panels/lovelace/cards/hui-picture-card.ts | 5 ++++- .../editor/config-elements/hui-picture-card-editor.ts | 2 +- 8 files changed, 23 insertions(+), 9 deletions(-) diff --git a/gallery/src/pages/components/ha-alert.ts b/gallery/src/pages/components/ha-alert.ts index 29b297b43baa..edeb4d223bc9 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``, }, { diff --git a/src/components/ha-addon-picker.ts b/src/components/ha-addon-picker.ts index 0a70c3fdcb60..ae6ab774fce4 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/tile/ha-tile-image.ts b/src/components/tile/ha-tile-image.ts index 60043d3d57b2..9382ffb9569b 100644 --- a/src/components/tile/ha-tile-image.ts +++ b/src/components/tile/ha-tile-image.ts @@ -10,7 +10,9 @@ export class HaTileImage extends LitElement { protected render(): TemplateResult { return html`
- ${this.imageUrl ? html`${this.alt}` : null} + ${this.imageUrl + ? html`${this.alt}` + : null}
`; } diff --git a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts index 7fe34c41832c..542fa522c7a2 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.common.cancel")} diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index 0bd06ef44ef0..a3727ad5e18e 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -261,8 +261,8 @@ class HaConfigAreaPage extends SubscribeMixin(LitElement) { ${this.hass.localize( - ${this._config.alt_text} + ${this._config.alt_text} `; } 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 3e2fb2e1695d..ee75869fc6a2 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,7 +20,7 @@ const cardConfigStruct = assign( tap_action: optional(actionConfigStruct), hold_action: optional(actionConfigStruct), theme: optional(string()), - alt_text: optional(string()) + alt_text: optional(string()), }) ); From 09c2ddff7f759276d9c3a4c7bdf4d4908117f67d Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Tue, 13 Dec 2022 16:45:43 -0500 Subject: [PATCH 21/30] Revise alt text for tag QR --- src/translations/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translations/en.json b/src/translations/en.json index 98eb5b1ee06f..95ed27dc55f1 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1374,7 +1374,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 image for tag: {name}", + "qr_code_image": "QR code for tag {name}", "headers": { "icon": "Icon", "name": "Name", From 33dcab3815cdfce67fa4656a4c5332c97537868d Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Tue, 13 Dec 2022 16:47:11 -0500 Subject: [PATCH 22/30] Revise alt text for token QR --- src/translations/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translations/en.json b/src/translations/en.json index 95ed27dc55f1..aec9b47a1a8f 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -4463,7 +4463,7 @@ "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.", - "qr_code_image": "QR code image for long-lived access token: {name}" + "qr_code_image": "QR code for token {name}" } }, "shopping_list": { From c32c8355777174eb03682b4abaf5b4de87033612 Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Tue, 13 Dec 2022 16:48:25 -0500 Subject: [PATCH 23/30] Revise alternate to alternative --- src/translations/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translations/en.json b/src/translations/en.json index aec9b47a1a8f..e8bac51fa943 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -4119,7 +4119,7 @@ "description": "The Light card allows you to change the brightness of the light." }, "generic": { - "alt_text": "Alternate Text", + "alt_text": "Alternative Text", "aspect_ratio": "Aspect Ratio", "attribute": "Attribute", "camera_image": "Camera Entity", From 6e706c6af6aca96a5c507a617208e12db9d52021 Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Tue, 13 Dec 2022 16:49:44 -0500 Subject: [PATCH 24/30] Add alt to logo in gallery --- gallery/src/pages/components/ha-alert.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gallery/src/pages/components/ha-alert.ts b/gallery/src/pages/components/ha-alert.ts index edeb4d223bc9..a0d3f309fb31 100644 --- a/gallery/src/pages/components/ha-alert.ts +++ b/gallery/src/pages/components/ha-alert.ts @@ -99,7 +99,7 @@ const alerts: { type: "warning", iconSlot: html``, }, From 23b695949c0f7d83488fee0cd342fa87186032cb Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Wed, 14 Dec 2022 01:19:51 -0500 Subject: [PATCH 25/30] Add alt text to crop image --- src/dialogs/image-cropper-dialog/image-cropper-dialog.ts | 2 +- src/translations/en.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts b/src/dialogs/image-cropper-dialog/image-cropper-dialog.ts index 542fa522c7a2..94b6d22065c7 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/translations/en.json b/src/translations/en.json index e8bac51fa943..c0464de49e21 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -747,7 +747,8 @@ "close": "Close" }, "image_cropper": { - "crop": "Crop" + "crop": "Crop", + "crop_image": "Picture to crop" }, "more_info_control": { "dismiss": "Dismiss dialog", From a6109a9e085b6daf5ee1bf844643a2b626df8fa4 Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Wed, 14 Dec 2022 09:55:54 -0500 Subject: [PATCH 26/30] Use ifDefined for tile image alt --- src/components/tile/ha-tile-image.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/tile/ha-tile-image.ts b/src/components/tile/ha-tile-image.ts index 9382ffb9569b..783b22583b04 100644 --- a/src/components/tile/ha-tile-image.ts +++ b/src/components/tile/ha-tile-image.ts @@ -1,17 +1,18 @@ import { CSSResultGroup, html, css, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; +import { ifDefined } from "lit/directives/if-defined"; @customElement("ha-tile-image") export class HaTileImage extends LitElement { @property() public imageUrl?: string; - @property() public alt?: string; + @property() public imageAlt?: string; protected render(): TemplateResult { return html`
${this.imageUrl - ? html`${this.alt}` + ? html`${ifDefined(this.imageAlt)}` : null}
`; From 92906ff616264ec57616fd88232dd64dcc46a43f Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Thu, 22 Dec 2022 05:11:32 +0000 Subject: [PATCH 27/30] Change area picture alt to area name --- src/panels/config/areas/ha-config-area-page.ts | 7 +------ src/translations/en.json | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index a3727ad5e18e..2c5fee76fa61 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -258,12 +258,7 @@ class HaConfigAreaPage extends SubscribeMixin(LitElement) {
${area.picture ? html`
- ${this.hass.localize( + ${area.name} Date: Thu, 22 Dec 2022 05:37:07 +0000 Subject: [PATCH 28/30] Remove entry from entities config struct --- src/panels/lovelace/editor/structs/entities-struct.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/panels/lovelace/editor/structs/entities-struct.ts b/src/panels/lovelace/editor/structs/entities-struct.ts index 09407689d286..837f621b19f8 100644 --- a/src/panels/lovelace/editor/structs/entities-struct.ts +++ b/src/panels/lovelace/editor/structs/entities-struct.ts @@ -14,7 +14,6 @@ export const entitiesConfigStruct = union([ tap_action: optional(actionConfigStruct), hold_action: optional(actionConfigStruct), double_tap_action: optional(actionConfigStruct), - alt_text: optional(string()), }), string(), ]); From d43619ee5ad15b95bc51041ccfa88fe95c5bb0c2 Mon Sep 17 00:00:00 2001 From: Giacomo Ferrari Date: Fri, 23 Dec 2022 11:32:04 -0800 Subject: [PATCH 29/30] Revert altText changes for Picture Entity Card (to revisit in future PR) See: https://github.com/home-assistant/frontend/pull/14405#discussion_r1032735871 --- src/panels/lovelace/cards/hui-picture-entity-card.ts | 1 - src/panels/lovelace/cards/types.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/panels/lovelace/cards/hui-picture-entity-card.ts b/src/panels/lovelace/cards/hui-picture-entity-card.ts index 629e8a6f5c23..aaab63cb0f63 100644 --- a/src/panels/lovelace/cards/hui-picture-entity-card.ts +++ b/src/panels/lovelace/cards/hui-picture-entity-card.ts @@ -143,7 +143,6 @@ class HuiPictureEntityCard extends LitElement implements LovelaceCard { Date: Thu, 29 Dec 2022 00:53:18 +0000 Subject: [PATCH 30/30] Revert changes to hui-image and picture entity editor --- src/panels/lovelace/components/hui-image.ts | 3 --- .../editor/config-elements/hui-picture-entity-card-editor.ts | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/panels/lovelace/components/hui-image.ts b/src/panels/lovelace/components/hui-image.ts index fbc8dbeb4837..555bca93ad49 100644 --- a/src/panels/lovelace/components/hui-image.ts +++ b/src/panels/lovelace/components/hui-image.ts @@ -58,8 +58,6 @@ export class HuiImage extends LitElement { @property() public darkModeFilter?: string; - @property() public altText?: string; - @state() private _imageVisible? = false; @state() private _loadState?: LoadState; @@ -225,7 +223,6 @@ export class HuiImage extends LitElement { : html`