mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 20:26:39 +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"
|
"ui.panel.config.core.section.core.core_config.unit_system"
|
||||||
)}
|
)}
|
||||||
</div>
|
</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}>
|
<paper-radio-button name="metric" .disabled=${this._working}>
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
"ui.panel.config.core.section.core.core_config.unit_system_metric"
|
"ui.panel.config.core.section.core.core_config.unit_system_metric"
|
||||||
@ -238,6 +242,12 @@ class OnboardingCoreConfig extends LitElement {
|
|||||||
this[`_${target.name}`] = target.value;
|
this[`_${target.name}`] = target.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _unitSystemChanged(
|
||||||
|
ev: PolymerChangedEvent<ConfigUpdateValues["unit_system"]>
|
||||||
|
) {
|
||||||
|
this._unitSystem = ev.detail.value;
|
||||||
|
}
|
||||||
|
|
||||||
private async _detect() {
|
private async _detect() {
|
||||||
this._working = true;
|
this._working = true;
|
||||||
try {
|
try {
|
||||||
|
@ -129,7 +129,11 @@ class ConfigCoreForm extends LitElement {
|
|||||||
"ui.panel.config.core.section.core.core_config.unit_system"
|
"ui.panel.config.core.section.core.core_config.unit_system"
|
||||||
)}
|
)}
|
||||||
</div>
|
</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}>
|
<paper-radio-button name="metric" .disabled=${disabled}>
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
"ui.panel.config.core.section.core.core_config.unit_system_metric"
|
"ui.panel.config.core.section.core.core_config.unit_system_metric"
|
||||||
@ -209,6 +213,12 @@ class ConfigCoreForm extends LitElement {
|
|||||||
this[`_${target.name}`] = target.value;
|
this[`_${target.name}`] = target.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _unitSystemChanged(
|
||||||
|
ev: PolymerChangedEvent<ConfigUpdateValues["unit_system"]>
|
||||||
|
) {
|
||||||
|
this._unitSystem = ev.detail.value;
|
||||||
|
}
|
||||||
|
|
||||||
private async _save() {
|
private async _save() {
|
||||||
this._working = true;
|
this._working = true;
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user