From 5728d8ad1b25b900407ce2f47acf5783d370e3e3 Mon Sep 17 00:00:00 2001 From: Marius Date: Sun, 31 Dec 2017 13:50:01 +0200 Subject: [PATCH] Fixed issue #767 Operation mode influence between different thermostats (#771) * Fixed issue #767 Operation mode influence between different thermostats * Capitalised Operation to be consistent with the rest of controls --- src/more-infos/more-info-climate.html | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) 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 @@
- + @@ -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;