mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +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) {
|
private _aliasChanged(alias: string) {
|
||||||
if (this.scriptEntityId || this._entityId) {
|
if (
|
||||||
|
this.scriptEntityId ||
|
||||||
|
(this._entityId && this._entityId !== slugify(this._config!.alias))
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const aliasSlugify = slugify(alias);
|
const aliasSlugify = slugify(alias);
|
||||||
let id = aliasSlugify;
|
let id = aliasSlugify;
|
||||||
let i = 2;
|
let i = 2;
|
||||||
@ -595,6 +599,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
|
|||||||
private _valueChanged(ev: CustomEvent) {
|
private _valueChanged(ev: CustomEvent) {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
const values = ev.detail.value as any;
|
const values = ev.detail.value as any;
|
||||||
|
const currentId = this._entityId;
|
||||||
|
|
||||||
for (const key of Object.keys(values)) {
|
for (const key of Object.keys(values)) {
|
||||||
if (key === "sequence") {
|
if (key === "sequence") {
|
||||||
@ -603,7 +608,10 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
|
|||||||
|
|
||||||
const value = values[key];
|
const value = values[key];
|
||||||
|
|
||||||
if (value === this._config![key]) {
|
if (
|
||||||
|
value === this._config![key] ||
|
||||||
|
(key === "id" && currentId === value)
|
||||||
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user