diff --git a/src/dialogs/config-flow/show-dialog-config-flow.ts b/src/dialogs/config-flow/show-dialog-config-flow.ts index e987d6be40..c1d56c6d73 100644 --- a/src/dialogs/config-flow/show-dialog-config-flow.ts +++ b/src/dialogs/config-flow/show-dialog-config-flow.ts @@ -89,9 +89,13 @@ export const showConfigFlowDialog = ( }, renderShowFormStepFieldHelper(hass, step, field) { - return hass.localize( - `component.${step.handler}.config.step.${step.step_id}.data_description.${field.name}` + const description = hass.localize( + `component.${step.handler}.config.step.${step.step_id}.data_description.${field.name}`, + step.description_placeholders ); + return description + ? html`` + : ""; }, renderShowFormStepFieldError(hass, step, error) { diff --git a/src/dialogs/config-flow/show-dialog-data-entry-flow.ts b/src/dialogs/config-flow/show-dialog-data-entry-flow.ts index 380faaf064..1c5f407c69 100644 --- a/src/dialogs/config-flow/show-dialog-data-entry-flow.ts +++ b/src/dialogs/config-flow/show-dialog-data-entry-flow.ts @@ -61,7 +61,7 @@ export interface FlowConfig { hass: HomeAssistant, step: DataEntryFlowStepForm, field: HaFormSchema - ): string; + ): TemplateResult | string; renderShowFormStepFieldError( hass: HomeAssistant, diff --git a/src/dialogs/config-flow/show-dialog-options-flow.ts b/src/dialogs/config-flow/show-dialog-options-flow.ts index 560d9a2946..b043f1390c 100644 --- a/src/dialogs/config-flow/show-dialog-options-flow.ts +++ b/src/dialogs/config-flow/show-dialog-options-flow.ts @@ -93,9 +93,13 @@ export const showOptionsFlowDialog = ( }, renderShowFormStepFieldHelper(hass, step, field) { - return hass.localize( - `component.${configEntry.domain}.options.step.${step.step_id}.data_description.${field.name}` + const description = hass.localize( + `component.${configEntry.domain}.options.step.${step.step_id}.data_description.${field.name}`, + step.description_placeholders ); + return description + ? html`` + : ""; }, renderShowFormStepFieldError(hass, step, error) { diff --git a/src/dialogs/config-flow/step-flow-form.ts b/src/dialogs/config-flow/step-flow-form.ts index 6b1926e31f..55996eb494 100644 --- a/src/dialogs/config-flow/step-flow-form.ts +++ b/src/dialogs/config-flow/step-flow-form.ts @@ -10,12 +10,12 @@ import { } from "lit"; import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; +import "../../components/ha-alert"; import "../../components/ha-circular-progress"; import { computeInitialHaFormData } from "../../components/ha-form/compute-initial-ha-form-data"; -import type { HaFormSchema } from "../../components/ha-form/types"; import "../../components/ha-form/ha-form"; +import type { HaFormSchema } from "../../components/ha-form/types"; import "../../components/ha-markdown"; -import "../../components/ha-alert"; import type { DataEntryFlowStepForm } from "../../data/data_entry_flow"; import type { HomeAssistant } from "../../types"; import type { FlowConfig } from "./show-dialog-data-entry-flow"; @@ -167,7 +167,7 @@ class StepFlowForm extends LitElement { private _labelCallback = (field: HaFormSchema): string => this.flowConfig.renderShowFormStepFieldLabel(this.hass, this.step, field); - private _helperCallback = (field: HaFormSchema): string => + private _helperCallback = (field: HaFormSchema): string | TemplateResult => this.flowConfig.renderShowFormStepFieldHelper(this.hass, this.step, field); private _errorCallback = (error: string) => diff --git a/src/panels/config/repairs/show-dialog-repair-flow.ts b/src/panels/config/repairs/show-dialog-repair-flow.ts index a6fc3b73f6..2b1850a1c9 100644 --- a/src/panels/config/repairs/show-dialog-repair-flow.ts +++ b/src/panels/config/repairs/show-dialog-repair-flow.ts @@ -100,11 +100,15 @@ export const showRepairsFlowDialog = ( }, renderShowFormStepFieldHelper(hass, step, field) { - return hass.localize( + const description = hass.localize( `component.${issue.domain}.issues.${ issue.translation_key || issue.issue_id - }.fix_flow.step.${step.step_id}.data_description.${field.name}` + }.fix_flow.step.${step.step_id}.data_description.${field.name}`, + step.description_placeholders ); + return description + ? html`` + : ""; }, renderShowFormStepFieldError(hass, step, error) {