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
This commit is contained in:
Justin Weberg 2016-09-14 20:26:53 -05:00 committed by Paulus Schoutsen
parent ba588fc779
commit 792de4c6ac
2 changed files with 9 additions and 8 deletions

View File

@ -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) {

View File

@ -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;
}