mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Fix options and repair flow success (#25312)
This commit is contained in:
parent
3e053e07c6
commit
70fef59401
@ -129,70 +129,73 @@ class StepFlowCreateEntry extends LitElement {
|
|||||||
)}</span
|
)}</span
|
||||||
>`
|
>`
|
||||||
: nothing}
|
: nothing}
|
||||||
${devices.length === 0
|
${devices.length === 0 &&
|
||||||
? html`<p>
|
["options_flow", "repair_flow"].includes(this.flowConfig.flowType)
|
||||||
${localize(
|
? nothing
|
||||||
"ui.panel.config.integrations.config_flow.created_config",
|
: devices.length === 0
|
||||||
{ name: this.step.title }
|
? html`<p>
|
||||||
)}
|
${localize(
|
||||||
</p>`
|
"ui.panel.config.integrations.config_flow.created_config",
|
||||||
: html`
|
{ name: this.step.title }
|
||||||
<div class="devices">
|
|
||||||
${devices.map(
|
|
||||||
(device) => html`
|
|
||||||
<div class="device">
|
|
||||||
<div class="device-info">
|
|
||||||
${this.step.result?.domain
|
|
||||||
? html`<img
|
|
||||||
slot="graphic"
|
|
||||||
alt=${domainToName(
|
|
||||||
this.hass.localize,
|
|
||||||
this.step.result.domain
|
|
||||||
)}
|
|
||||||
src=${brandsUrl({
|
|
||||||
domain: this.step.result.domain,
|
|
||||||
type: "icon",
|
|
||||||
darkOptimized: this.hass.themes?.darkMode,
|
|
||||||
})}
|
|
||||||
crossorigin="anonymous"
|
|
||||||
referrerpolicy="no-referrer"
|
|
||||||
/>`
|
|
||||||
: nothing}
|
|
||||||
<div class="device-info-details">
|
|
||||||
<span>${device.model || device.manufacturer}</span>
|
|
||||||
${device.model
|
|
||||||
? html`<span class="secondary">
|
|
||||||
${device.manufacturer}
|
|
||||||
</span>`
|
|
||||||
: nothing}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ha-textfield
|
|
||||||
.label=${localize(
|
|
||||||
"ui.panel.config.integrations.config_flow.device_name"
|
|
||||||
)}
|
|
||||||
.placeholder=${computeDeviceNameDisplay(
|
|
||||||
device,
|
|
||||||
this.hass
|
|
||||||
)}
|
|
||||||
.value=${this._deviceUpdate[device.id]?.name ??
|
|
||||||
computeDeviceName(device)}
|
|
||||||
@change=${this._deviceNameChanged}
|
|
||||||
.device=${device.id}
|
|
||||||
></ha-textfield>
|
|
||||||
<ha-area-picker
|
|
||||||
.hass=${this.hass}
|
|
||||||
.device=${device.id}
|
|
||||||
.value=${this._deviceUpdate[device.id]?.area ??
|
|
||||||
device.area_id ??
|
|
||||||
undefined}
|
|
||||||
@value-changed=${this._areaPicked}
|
|
||||||
></ha-area-picker>
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</p>`
|
||||||
`}
|
: html`
|
||||||
|
<div class="devices">
|
||||||
|
${devices.map(
|
||||||
|
(device) => html`
|
||||||
|
<div class="device">
|
||||||
|
<div class="device-info">
|
||||||
|
${this.step.result?.domain
|
||||||
|
? html`<img
|
||||||
|
slot="graphic"
|
||||||
|
alt=${domainToName(
|
||||||
|
this.hass.localize,
|
||||||
|
this.step.result.domain
|
||||||
|
)}
|
||||||
|
src=${brandsUrl({
|
||||||
|
domain: this.step.result.domain,
|
||||||
|
type: "icon",
|
||||||
|
darkOptimized: this.hass.themes?.darkMode,
|
||||||
|
})}
|
||||||
|
crossorigin="anonymous"
|
||||||
|
referrerpolicy="no-referrer"
|
||||||
|
/>`
|
||||||
|
: nothing}
|
||||||
|
<div class="device-info-details">
|
||||||
|
<span>${device.model || device.manufacturer}</span>
|
||||||
|
${device.model
|
||||||
|
? html`<span class="secondary">
|
||||||
|
${device.manufacturer}
|
||||||
|
</span>`
|
||||||
|
: nothing}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ha-textfield
|
||||||
|
.label=${localize(
|
||||||
|
"ui.panel.config.integrations.config_flow.device_name"
|
||||||
|
)}
|
||||||
|
.placeholder=${computeDeviceNameDisplay(
|
||||||
|
device,
|
||||||
|
this.hass
|
||||||
|
)}
|
||||||
|
.value=${this._deviceUpdate[device.id]?.name ??
|
||||||
|
computeDeviceName(device)}
|
||||||
|
@change=${this._deviceNameChanged}
|
||||||
|
.device=${device.id}
|
||||||
|
></ha-textfield>
|
||||||
|
<ha-area-picker
|
||||||
|
.hass=${this.hass}
|
||||||
|
.device=${device.id}
|
||||||
|
.value=${this._deviceUpdate[device.id]?.area ??
|
||||||
|
device.area_id ??
|
||||||
|
undefined}
|
||||||
|
@value-changed=${this._areaPicked}
|
||||||
|
></ha-area-picker>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
`}
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<mwc-button @click=${this._flowDone}
|
<mwc-button @click=${this._flowDone}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user