diff --git a/src/more-infos/more-info-climate.html b/src/more-infos/more-info-climate.html
index bfa660f581..d200e77843 100644
--- a/src/more-infos/more-info-climate.html
+++ b/src/more-infos/more-info-climate.html
@@ -147,10 +147,11 @@
-
+
+ items='[[stateObj.attributes.operation_list]]'
+ on-dom-change='handleOperationListUpdate'>
[[item]]
@@ -256,13 +257,6 @@ class MoreInfoClimate extends window.hassMixins.EventsMixin(Polymer.Element) {
this.fanIndex = -1;
}
- if (newVal.attributes.operation_list) {
- this.operationIndex =
- newVal.attributes.operation_list.indexOf(newVal.attributes.operation_mode);
- } else {
- this.operationIndex = -1;
- }
-
if (newVal.attributes.swing_list) {
this.swingIndex = newVal.attributes.swing_list.indexOf(newVal.attributes.swing_mode);
} else {
@@ -276,6 +270,17 @@ class MoreInfoClimate extends window.hassMixins.EventsMixin(Polymer.Element) {
}
}
+ handleOperationListUpdate() {
+ // force polymer to recognize selected item change (to update actual label)
+ this.operationIndex = -1;
+ if (this.stateObj.attributes.operation_list) {
+ this.operationIndex =
+ this.stateObj.attributes.operation_list.indexOf(this.stateObj.attributes.operation_mode);
+ } else {
+ this.operationIndex = -1;
+ }
+ }
+
computeTemperatureStepSize(stateObj) {
if (stateObj.attributes.target_temp_step) {
return stateObj.attributes.target_temp_step;