mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-07 17:36:35 +00:00
Fix climate chart with unavailable states (#737)
This commit is contained in:
parent
91fadccf33
commit
1aa1ac709d
@ -172,9 +172,8 @@
|
||||
if (domain === 'thermostat' || domain === 'climate') {
|
||||
// We differentiate between thermostats that have a target temperature
|
||||
// range versus ones that have just a target temperature
|
||||
hasTargetRange = states.states.reduce(function (cum, cur) {
|
||||
return cum || cur.attributes.target_temp_high !== cur.attributes.target_temp_low;
|
||||
}, false);
|
||||
hasTargetRange = states.states.some(state => state.attributes &&
|
||||
state.attributes.target_temp_high !== state.attributes.target_temp_low);
|
||||
|
||||
dataTable.addColumn('number', name + ' current temperature');
|
||||
dataTable.addColumn('number', name + ' heating');
|
||||
@ -195,6 +194,7 @@
|
||||
}
|
||||
|
||||
processState = function (state) {
|
||||
if (!state.attributes) return;
|
||||
var curTemp = saveParseFloat(state.attributes.current_temperature);
|
||||
// Drawing the 'heating' area up to the current temp should keep it from
|
||||
// overlapping but avoid any weird gaps or range mismatches
|
||||
|
Loading…
x
Reference in New Issue
Block a user