mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 08:46:35 +00:00
Allow climate platforms to specify temperature step (#270)
* Allow climate platforms to specify temperature step * Update more-info-climate.html
This commit is contained in:
parent
fe0aa77749
commit
928be4eed5
@ -102,7 +102,7 @@
|
|||||||
<ha-climate-control
|
<ha-climate-control
|
||||||
value='[[stateObj.attributes.temperature]]'
|
value='[[stateObj.attributes.temperature]]'
|
||||||
units='[[stateObj.attributes.unit_of_measurement]]'
|
units='[[stateObj.attributes.unit_of_measurement]]'
|
||||||
step='[[computeTemperatureStepSize(stateObj.attributes.unit_of_measurement)]]'
|
step='[[computeTemperatureStepSize(stateObj)]]'
|
||||||
min='[[stateObj.attributes.min_temp]]'
|
min='[[stateObj.attributes.min_temp]]'
|
||||||
max='[[stateObj.attributes.max_temp]]'
|
max='[[stateObj.attributes.max_temp]]'
|
||||||
on-change='targetTemperatureChanged'
|
on-change='targetTemperatureChanged'
|
||||||
@ -257,8 +257,10 @@ Polymer({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computeTemperatureStepSize: function (units) {
|
computeTemperatureStepSize: function (stateObj) {
|
||||||
if (units.indexOf('F') !== -1) {
|
if (stateObj.attributes.target_temp_step) {
|
||||||
|
return stateObj.attributes.target_temp_step;
|
||||||
|
} else if (stateObj.attributes.unit_of_measurement.indexOf('F') !== -1) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0.5;
|
return 0.5;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user