Skip to content

Commit

Permalink
Use localized operation modes in climate more-info (home-assistant#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
emlove authored and balloob committed Jun 20, 2018
1 parent 4acfa2b commit 626b054
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/dialogs/more-info/controls/more-info-climate.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
<style>
:host {
color: var(--primary-text-color);
--paper-input-container-input: {
text-transform: capitalize;
}
}
.container-on,
Expand Down Expand Up @@ -109,9 +106,6 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
.single-row {
padding: 8px 0;
}
.capitalize {
text-transform: capitalize;
}
</style>
Expand Down Expand Up @@ -157,10 +151,10 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
<template is="dom-if" if="[[supportsOperationMode(stateObj)]]">
<div class="container-operation_list">
<div class="controls">
<paper-dropdown-menu class="capitalize" label-float="" dynamic-align="" label="[[localize('ui.card.climate.operation')]]">
<paper-dropdown-menu label-float="" dynamic-align="" label="[[localize('ui.card.climate.operation')]]">
<paper-listbox slot="dropdown-content" selected="{{operationIndex}}">
<template is="dom-repeat" items="[[stateObj.attributes.operation_list]]" on-dom-change="handleOperationListUpdate">
<paper-item class="capitalize">[[item]]</paper-item>
<paper-item>[[_localizeOperationMode(localize, item)]]</paper-item>
</template>
</paper-listbox>
</paper-dropdown-menu>
Expand Down Expand Up @@ -463,6 +457,10 @@ class MoreInfoClimate extends LocalizeMixin(EventsMixin(PolymerElement)) {
this.stateObjChanged(this.stateObj);
});
}

_localizeOperationMode(localize, mode) {
return localize(`state.climate.${mode}`) || mode;
}
}

customElements.define('more-info-climate', MoreInfoClimate);

0 comments on commit 626b054

Please sign in to comment.