diff --git a/src/editor.ts b/src/editor.ts index 70343a8..ae6728b 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -35,6 +35,8 @@ const stub = { }, } +const cloneDeep = (obj) => JSON.parse(JSON.stringify(obj)) + export default class SimpleThermostatEditor extends LitElement { config: CardConfig hass: HASS @@ -235,7 +237,7 @@ export default class SimpleThermostatEditor extends LitElement { return } const { target } = ev - const copy = { ...this.config } + const copy = cloneDeep(this.config) if (target.configValue) { if (target.value === '') { delete copy[target.configValue]