Remove undefined key in lovelace card config (#14081)

This commit is contained in:
Paul Bottein 2022-10-13 14:31:55 +02:00 committed by GitHub
parent fe9967550b
commit 19887fbd54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,6 +271,11 @@ export abstract class HuiElementEditor<T> extends LitElement {
private _handleUIConfigChanged(ev: UIConfigChangedEvent) {
ev.stopPropagation();
const config = ev.detail.config;
Object.keys(config).forEach((key) => {
if (config[key] === undefined) {
delete config[key];
}
});
this.value = config as unknown as T;
}