mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 04:06:35 +00:00
Allow saving unit system (#3235)
This commit is contained in:
parent
35e82a8e26
commit
fe4811b278
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user