mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix blueprint script editor defaults handling (#16196)
This commit is contained in:
parent
648383addd
commit
046475e7ac
@ -194,7 +194,14 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
}
|
}
|
||||||
const input = { ...this.config.use_blueprint.input, [key]: value };
|
const input = { ...this.config.use_blueprint.input, [key]: value };
|
||||||
|
|
||||||
if (value === "" || value === undefined) {
|
const blueprint = this._blueprint;
|
||||||
|
const metaValue =
|
||||||
|
!blueprint || "error" in blueprint
|
||||||
|
? undefined
|
||||||
|
: blueprint?.metadata.input && blueprint?.metadata?.input[key];
|
||||||
|
const keyDefault = metaValue && metaValue.default;
|
||||||
|
|
||||||
|
if ((value === "" && !keyDefault) || value === undefined) {
|
||||||
delete input[key];
|
delete input[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +173,14 @@ export class HaBlueprintScriptEditor extends LitElement {
|
|||||||
}
|
}
|
||||||
const input = { ...this.config.use_blueprint.input, [key]: value };
|
const input = { ...this.config.use_blueprint.input, [key]: value };
|
||||||
|
|
||||||
if (value === "" || value === undefined) {
|
const blueprint = this._blueprint;
|
||||||
|
const metaValue =
|
||||||
|
!blueprint || "error" in blueprint
|
||||||
|
? undefined
|
||||||
|
: blueprint?.metadata.input && blueprint?.metadata?.input[key];
|
||||||
|
const keyDefault = metaValue && metaValue.default;
|
||||||
|
|
||||||
|
if ((value === "" && !keyDefault) || value === undefined) {
|
||||||
delete input[key];
|
delete input[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user