From f019bb095def39cf664dc8569ece6084043e712d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 29 May 2019 08:39:38 -0700 Subject: [PATCH] Allow edit default config (#3220) --- src/panels/config/core/ha-config-core-form.ts | 8 +++++--- src/panels/config/core/ha-config-name-form.ts | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/panels/config/core/ha-config-core-form.ts b/src/panels/config/core/ha-config-core-form.ts index 7ccb572dcc..6d363fc4b6 100644 --- a/src/panels/config/core/ha-config-core-form.ts +++ b/src/panels/config/core/ha-config-core-form.ts @@ -33,8 +33,10 @@ class ConfigCoreForm extends LitElement { @property() private _timeZone!: string; protected render(): TemplateResult | void { - const isStorage = this.hass.config.config_source === "storage"; - const disabled = this._working || !isStorage; + const canEdit = ["storage", "default"].includes( + this.hass.config.config_source + ); + const disabled = this._working || !canEdit; return html`
- ${!isStorage + ${!canEdit ? html`

${this.hass.localize( diff --git a/src/panels/config/core/ha-config-name-form.ts b/src/panels/config/core/ha-config-name-form.ts index e2cef443fa..32355e575f 100644 --- a/src/panels/config/core/ha-config-name-form.ts +++ b/src/panels/config/core/ha-config-name-form.ts @@ -25,13 +25,15 @@ class ConfigNameForm extends LitElement { @property() private _name!: ConfigUpdateValues["location_name"]; protected render(): TemplateResult | void { - const isStorage = this.hass.config.config_source === "storage"; - const disabled = this._working || !isStorage; + const canEdit = ["storage", "default"].includes( + this.hass.config.config_source + ); + const disabled = this._working || !canEdit; return html`

- ${!isStorage + ${!canEdit ? html`

${this.hass.localize(