mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 18:06:36 +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') {
|
if (domain === 'thermostat' || domain === 'climate') {
|
||||||
// We differentiate between thermostats that have a target temperature
|
// We differentiate between thermostats that have a target temperature
|
||||||
// range versus ones that have just a target temperature
|
// range versus ones that have just a target temperature
|
||||||
hasTargetRange = states.states.reduce(function (cum, cur) {
|
hasTargetRange = states.states.some(state => state.attributes &&
|
||||||
return cum || cur.attributes.target_temp_high !== cur.attributes.target_temp_low;
|
state.attributes.target_temp_high !== state.attributes.target_temp_low);
|
||||||
}, false);
|
|
||||||
|
|
||||||
dataTable.addColumn('number', name + ' current temperature');
|
dataTable.addColumn('number', name + ' current temperature');
|
||||||
dataTable.addColumn('number', name + ' heating');
|
dataTable.addColumn('number', name + ' heating');
|
||||||
@ -195,6 +194,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
processState = function (state) {
|
processState = function (state) {
|
||||||
|
if (!state.attributes) return;
|
||||||
var curTemp = saveParseFloat(state.attributes.current_temperature);
|
var curTemp = saveParseFloat(state.attributes.current_temperature);
|
||||||
// Drawing the 'heating' area up to the current temp should keep it from
|
// Drawing the 'heating' area up to the current temp should keep it from
|
||||||
// overlapping but avoid any weird gaps or range mismatches
|
// overlapping but avoid any weird gaps or range mismatches
|
||||||
|
Loading…
x
Reference in New Issue
Block a user