From e6600fecac6144cf0fa24a179c2a2dcb040b05a4 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Sun, 20 Oct 2019 13:53:36 -0400 Subject: [PATCH] =?UTF-8?q?Fixed=20#158=20-=20Runtime=20Summary=20-=20Temp?= =?UTF-8?q?erature=20units=20are=20correct=20but=20values=20are=20in=20?= =?UTF-8?q?=C2=B0F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forgot about temperature extremes. --- js/component/card/runtime_thermostat_summary.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/component/card/runtime_thermostat_summary.js b/js/component/card/runtime_thermostat_summary.js index df1447d..a18b083 100755 --- a/js/component/card/runtime_thermostat_summary.js +++ b/js/component/card/runtime_thermostat_summary.js @@ -379,16 +379,22 @@ beestat.component.card.runtime_thermostat_summary.prototype.get_buckets_combined bucket[key] = sum / bucket[key].length; if (key.substring(key.length - 11) === 'temperature') { - bucket[key] = beestat.temperature(Math.round(bucket[key] * 10) / 10); - } else { - bucket[key] = Math.round(bucket[key]); + bucket[key] = beestat.temperature(bucket[key]); } + + bucket[key] = Math.round(bucket[key]); break; case 'min': bucket[key] = Math.min.apply(null, bucket[key]); + if (key.substring(key.length - 11) === 'temperature') { + bucket[key] = beestat.temperature(bucket[key]); + } break; case 'max': bucket[key] = Math.max.apply(null, bucket[key]); + if (key.substring(key.length - 11) === 'temperature') { + bucket[key] = beestat.temperature(bucket[key]); + } break; case 'sum': bucket[key] = bucket[key].reduce(function(accumulator, current_value) {