Allow saving unit system (#3235)

This commit is contained in:
Paulus Schoutsen 2019-05-31 15:51:12 -07:00 committed by GitHub
parent 35e82a8e26
commit fe4811b278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -142,7 +142,11 @@ class OnboardingCoreConfig extends LitElement {
"ui.panel.config.core.section.core.core_config.unit_system"
)}
</div>
<paper-radio-group class="flex" .selected=${this._unitSystemValue}>
<paper-radio-group
class="flex"
.selected=${this._unitSystemValue}
@selected-changed=${this._unitSystemChanged}
>
<paper-radio-button name="metric" .disabled=${this._working}>
${this.hass.localize(
"ui.panel.config.core.section.core.core_config.unit_system_metric"
@ -238,6 +242,12 @@ class OnboardingCoreConfig extends LitElement {
this[`_${target.name}`] = target.value;
}
private _unitSystemChanged(
ev: PolymerChangedEvent<ConfigUpdateValues["unit_system"]>
) {
this._unitSystem = ev.detail.value;
}
private async _detect() {
this._working = true;
try {

View File

@ -129,7 +129,11 @@ class ConfigCoreForm extends LitElement {
"ui.panel.config.core.section.core.core_config.unit_system"
)}
</div>
<paper-radio-group class="flex" .selected=${this._unitSystemValue}>
<paper-radio-group
class="flex"
.selected=${this._unitSystemValue}
@selected-changed=${this._unitSystemChanged}
>
<paper-radio-button name="metric" .disabled=${disabled}>
${this.hass.localize(
"ui.panel.config.core.section.core.core_config.unit_system_metric"
@ -209,6 +213,12 @@ class ConfigCoreForm extends LitElement {
this[`_${target.name}`] = target.value;
}
private _unitSystemChanged(
ev: PolymerChangedEvent<ConfigUpdateValues["unit_system"]>
) {
this._unitSystem = ev.detail.value;
}
private async _save() {
this._working = true;
try {