From 792de4c6acea68411880b5ebac3e11464abf49fc Mon Sep 17 00:00:00 2001 From: Justin Weberg Date: Wed, 14 Sep 2016 20:26:53 -0500 Subject: [PATCH] Fix for home-assistant/home-assistant/issues/3378 (#108) * Fix for home-assistant/home-assistant/issues/3378 * Update state-card-climate.html Fix Travis Error * Fix more-infos display sliders based on target temps not range --- src/more-infos/more-info-climate.html | 10 ++++++---- src/state-summary/state-card-climate.html | 7 +++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/more-infos/more-info-climate.html b/src/more-infos/more-info-climate.html index a9a666b716..b3a079a3d6 100644 --- a/src/more-infos/more-info-climate.html +++ b/src/more-infos/more-info-climate.html @@ -241,16 +241,18 @@ Polymer({ }, computeTargetTempHidden: function (stateObj) { - return stateObj.attributes.operation_mode === 'off'; + return !stateObj.attributes.temperature && + !stateObj.attributes.target_temp_low && + !stateObj.attributes.target_temp_high; }, computeHideTempRangeSlider: function (stateObj) { - return stateObj.attributes.operation_mode !== 'auto'; + return !stateObj.attributes.target_temp_low && + !stateObj.attributes.target_temp_high; }, computeHideTempSlider: function (stateObj) { - return stateObj.attributes.operation_mode === 'auto' || - stateObj.attributes.operation_mode === 'off'; + return !stateObj.attributes.temperature; }, computeClassNames: function (stateObj) { diff --git a/src/state-summary/state-card-climate.html b/src/state-summary/state-card-climate.html index 946f4f5a7f..bdcedab1f4 100644 --- a/src/state-summary/state-card-climate.html +++ b/src/state-summary/state-card-climate.html @@ -72,13 +72,12 @@ Polymer({ computeTargetTemperature: function (stateObj) { var stateTemp = ''; - if (stateObj.attributes.operation_mode === 'off') { - stateTemp = ''; - } else if (stateObj.attributes.operation_mode === 'auto') { + if (stateObj.attributes.target_temp_low && + stateObj.attributes.target_temp_high) { stateTemp = stateObj.attributes.target_temp_low + ' - ' + stateObj.attributes.target_temp_high + ' ' + stateObj.attributes.unit_of_measurement; - } else { + } else if (stateObj.attributes.temperature) { stateTemp = stateObj.attributes.temperature + ' ' + stateObj.attributes.unit_of_measurement; }