mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +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
|
||||
value='[[stateObj.attributes.temperature]]'
|
||||
units='[[stateObj.attributes.unit_of_measurement]]'
|
||||
step='[[computeTemperatureStepSize(stateObj.attributes.unit_of_measurement)]]'
|
||||
step='[[computeTemperatureStepSize(stateObj)]]'
|
||||
min='[[stateObj.attributes.min_temp]]'
|
||||
max='[[stateObj.attributes.max_temp]]'
|
||||
on-change='targetTemperatureChanged'
|
||||
@ -257,8 +257,10 @@ Polymer({
|
||||
}
|
||||
},
|
||||
|
||||
computeTemperatureStepSize: function (units) {
|
||||
if (units.indexOf('F') !== -1) {
|
||||
computeTemperatureStepSize: function (stateObj) {
|
||||
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 0.5;
|
||||
|
Loading…
x
Reference in New Issue
Block a user