Prevent empty brackets if no manufacturer during config entry creation (#12288)

This commit is contained in:
Philip Allgaier 2022-04-11 16:06:29 +02:00 committed by GitHub
parent 714f2447b7
commit e751abd775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -28,7 +28,7 @@ class StepFlowCreateEntry extends LitElement {
const localize = this.hass.localize;
return html`
<h2>Success!</h2>
<h2>${localize("ui.panel.config.integrations.config_flow.success")}!</h2>
<div class="content">
${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`
<p>We found the following devices:</p>
<p>
${localize(
"ui.panel.config.integrations.config_flow.found_following_devices"
)}:
</p>
<div class="devices">
${this.devices.map(
(device) =>
@ -49,7 +53,12 @@ class StepFlowCreateEntry extends LitElement {
<div class="device">
<div>
<b>${computeDeviceName(device, this.hass)}</b><br />
${device.model} (${device.manufacturer})
${!device.model && !device.manufacturer
? html`&nbsp;`
: html`${device.model}
${device.manufacturer
? html`(${device.manufacturer})`
: ""}`}
</div>
<ha-area-picker
.hass=${this.hass}

View File

@ -2711,12 +2711,14 @@
"open_configuration_url": "Visit device"
},
"config_flow": {
"success": "Success",
"aborted": "Aborted",
"close": "Close",
"dismiss": "Dismiss dialog",
"finish": "Finish",
"submit": "Submit",
"next": "Next",
"found_following_devices": "We found the following devices",
"no_config_flow": "This integration does not support configuration via the UI. If you followed this link from the Home Assistant website, make sure you run the latest version of Home Assistant.",
"not_all_required_fields": "Not all required fields are filled in.",
"error_saving_area": "Error saving area: {error}",