mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Script ID update with Alias (#12008)
This commit is contained in:
parent
affa6a92e7
commit
307aa161a6
@ -569,9 +569,13 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
|
||||
}
|
||||
|
||||
private _aliasChanged(alias: string) {
|
||||
if (this.scriptEntityId || this._entityId) {
|
||||
if (
|
||||
this.scriptEntityId ||
|
||||
(this._entityId && this._entityId !== slugify(this._config!.alias))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const aliasSlugify = slugify(alias);
|
||||
let id = aliasSlugify;
|
||||
let i = 2;
|
||||
@ -595,6 +599,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
|
||||
private _valueChanged(ev: CustomEvent) {
|
||||
ev.stopPropagation();
|
||||
const values = ev.detail.value as any;
|
||||
const currentId = this._entityId;
|
||||
|
||||
for (const key of Object.keys(values)) {
|
||||
if (key === "sequence") {
|
||||
@ -603,7 +608,10 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
|
||||
|
||||
const value = values[key];
|
||||
|
||||
if (value === this._config![key]) {
|
||||
if (
|
||||
value === this._config![key] ||
|
||||
(key === "id" && currentId === value)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user