Allow edit default config (#3220)

This commit is contained in:
Paulus Schoutsen 2019-05-29 08:39:38 -07:00 committed by GitHub
parent 1ad9d2e54c
commit f019bb095d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -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`
<ha-card
@ -43,7 +45,7 @@ class ConfigCoreForm extends LitElement {
)}
>
<div class="card-content">
${!isStorage
${!canEdit
? html`
<p>
${this.hass.localize(

View File

@ -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`
<ha-card>
<div class="card-content">
${!isStorage
${!canEdit
? html`
<p>
${this.hass.localize(