mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +00:00
Use original id to remove entity (#4829)
This commit is contained in:
parent
e7e8dff0ec
commit
2c006e99f2
@ -177,26 +177,27 @@ export class EntityRegistrySettings extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _deleteEntry(): Promise<void> {
|
private async _confirmDeleteEntry(): Promise<void> {
|
||||||
|
if (
|
||||||
|
!(await showConfirmationDialog(this, {
|
||||||
|
text: this.hass.localize(
|
||||||
|
"ui.dialogs.entity_registry.editor.confirm_delete"
|
||||||
|
),
|
||||||
|
}))
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._submitting = true;
|
this._submitting = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await removeEntityRegistryEntry(this.hass!, this._entityId);
|
await removeEntityRegistryEntry(this.hass!, this._origEntityId);
|
||||||
fireEvent(this as HTMLElement, "close-dialog");
|
fireEvent(this as HTMLElement, "close-dialog");
|
||||||
} finally {
|
} finally {
|
||||||
this._submitting = false;
|
this._submitting = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _confirmDeleteEntry(): void {
|
|
||||||
showConfirmationDialog(this, {
|
|
||||||
text: this.hass.localize(
|
|
||||||
"ui.dialogs.entity_registry.editor.confirm_delete"
|
|
||||||
),
|
|
||||||
confirm: () => this._deleteEntry(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private _disabledByChanged(ev: Event): void {
|
private _disabledByChanged(ev: Event): void {
|
||||||
this._disabledBy = (ev.target as HaSwitch).checked ? null : "user";
|
this._disabledBy = (ev.target as HaSwitch).checked ? null : "user";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user