From e751abd77542f8c8fda5d8f7f5d17611ee45e34a Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Mon, 11 Apr 2022 16:06:29 +0200 Subject: [PATCH] Prevent empty brackets if no manufacturer during config entry creation (#12288) --- src/dialogs/config-flow/step-flow-create-entry.ts | 15 ++++++++++++--- src/translations/en.json | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/dialogs/config-flow/step-flow-create-entry.ts b/src/dialogs/config-flow/step-flow-create-entry.ts index 6431bcc48b..32fb7f09cb 100644 --- a/src/dialogs/config-flow/step-flow-create-entry.ts +++ b/src/dialogs/config-flow/step-flow-create-entry.ts @@ -28,7 +28,7 @@ class StepFlowCreateEntry extends LitElement { const localize = this.hass.localize; return html` -

Success!

+

${localize("ui.panel.config.integrations.config_flow.success")}!

${this.flowConfig.renderCreateEntryDescription(this.hass, this.step)} ${this.step.result?.state === "not_loaded" @@ -41,7 +41,11 @@ class StepFlowCreateEntry extends LitElement { ${this.devices.length === 0 ? "" : html` -

We found the following devices:

+

+ ${localize( + "ui.panel.config.integrations.config_flow.found_following_devices" + )}: +

${this.devices.map( (device) => @@ -49,7 +53,12 @@ class StepFlowCreateEntry extends LitElement {
${computeDeviceName(device, this.hass)}
- ${device.model} (${device.manufacturer}) + ${!device.model && !device.manufacturer + ? html` ` + : html`${device.model} + ${device.manufacturer + ? html`(${device.manufacturer})` + : ""}`}