Add missing localization for Fan Mode in Climate More Info (#2716)

* Add missing localization for Fan Mode in Climate More Info

* Separate Climate Fan Mode from Operation Mode

* Separated out climate.fan_mode into state_attributess

Separated out climate.fan_mode into state_attributess

* Fix bad merge and update localizeFanMode funtion.
This commit is contained in:
shbatm 2019-02-18 23:47:15 -06:00 committed by Paulus Schoutsen
parent c8cda3c817
commit 79a5947587
3 changed files with 23 additions and 1 deletions

View File

@ -227,7 +227,7 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
items="[[stateObj.attributes.fan_list]]"
on-dom-change="handleFanListUpdate"
>
<paper-item>[[item]]</paper-item>
<paper-item>[[_localizeFanMode(localize, item)]]</paper-item>
</template>
</paper-listbox>
</paper-dropdown-menu>
@ -553,6 +553,10 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
_localizeOperationMode(localize, mode) {
return localize(`state.climate.${mode}`) || mode;
}
_localizeFanMode(localize, mode) {
return localize(`state_attributes.climate.fan_mode.${mode}`) || mode;
}
}
customElements.define("more-info-climate", MoreInfoClimate);

View File

@ -315,6 +315,15 @@
}
}
},
"state_attributes": {
"climate": {
"fan_mode": {
"off": "[%key:state::default::off%]",
"on": "[%key:state::default::on%]",
"auto": "[%key:state::climate::auto%]"
}
}
},
"state_badge": {
"default": {
"unknown": "Unk",

View File

@ -267,6 +267,15 @@
"returning": "Returning to dock"
}
},
"state_attributes": {
"climate": {
"fan_mode": {
"off": "Off",
"on": "On",
"auto": "Auto"
}
}
},
"state_badge": {
"default": {
"unknown": "Unk",